Cannot output database entries.
-
I am trying to request things from the database. But it does not working. Is there anything I am doing wrong? If so how would I get the information from the database and display it on a page.
function retrieve_requests(){
global $wpdb;$query = (“SELECT id, name, request FROM $wpdb->my_table ORDER BY id”);
$rows = $wpdb->get_results($query, OBJECT);
foreach($rows as $row){
echo $row->id;
echo $row->name;
echo $row->request;
}
}retrieve_requests();
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Cannot output database entries.’ is closed to new replies.