$db_name = "joechris";
$table_name = "foodcomp";
$connection = @mysql_connect("localhost", "joechris", "uc5b7vim")
or die(mysql_error());
$db = @mysql_select_db($db_name, $connection) or die(mysql_error());
//start creating the SQL statement
$sql = "select id, food_name from $table_name ORDER BY food_name";
$result = @mysql_query($sql, $connection) or die (mysql_error());
$food_list = "
";
while ($row=mysql_fetch_array($result)) {
$id = $row['id'];
$food_name = $row['food_name'];
$food_list .= "- $food_name";
}
$food_list .= "
";
?>
Powered by The Nutrition and Food Web Archive