WordPress get_results from custom table
-
Hi
I am working on a plugin. It is my first one where i create a new table. I have got the creating part working.
In the settings-section i have a select box i want to fill with places from the table.
The code i have now is taken from the codex:
global $wpdb; $fivesdrafts = $wpdb->get_results( " SELECT name FROM $wpdb->testdatabase ", OBJECT ); foreach ( $fivesdrafts as $fivesdraft ) { echo "<option>". $fivesdraft . "</option>"; }
When i check the page the select-box is completly empty. I have tried to fill the select-box with hard coded text and it worked, so my function is working.
Anyone know what the problem is?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘WordPress get_results from custom table’ is closed to new replies.