<?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;
?><p><?php echo $id; ?></p><?php
?><p><?php echo $name; ?></p><?php
?><p><?php echo $organic; ?></p><?php
}
?>