If your have the food choices in a table with fields for the food name, and the food id, this should be pretty easy. I'm not sure how you are storing you users choices, but (someone correct me if i'm wrong) the best method I can think of is to have a link table that holds the user_id and the food_id of their choice, having a row for each record.
//assuming you have a link table for choices like i described.
$q = "SELECT * FROM `user_food_choices` WHERE `usesr_id` = '".$user_id."'";
$res = mysql_query($q);
$user_choices = array();
while($choice = mysql_fetch_array($res)){
$user_choices[$row['choice_id']] = $row['choice_id'];
}
$sql = "SELECT * FROM `food_choices`";
$result = mysql_query($result);
if(!$result){
echo "Failed to get food choices.<br>";
}
while($row = mysql_fetch_array($result)){
$checked = '';
if(in_array($row['food_id'], $user_choices)){
$checked = 'checked';
}
echo "<input type=\"checkbox\" name=\"foodChoice[".$row['food_id']."]\" value=\"checkbox\" ".$checked." />";
}
If you were dead set on having only one row in the table for each user you would have to explode the choices field, so you can separate each one into an array value, then do a compare like above based on the name.
To process the form you loop through the food_choice post array.
foreach($_POST['food_choice'] as $food_id){
//do whatever with this data.
echo $food_id."<br>";
}