/ Published in: PHP
Refer to the following: http://codex.wordpress.org/Class_Reference/wpdb
Expand |
Embed | Plain Text
<?php /* Say you created a TABLE named food in the wordpress database WITH THE COLUMNS id name organic YES/NO */ global $wpdb; $query = 'SELECT id, name, organic FROM food'; $rows = $wpdb -> get_results($query); foreach ($rows as $key=> $value) { $id = $value->id; $name = $value->name; $organic = value->organic; } ?>
You need to login to post a comment.
