PHP Online Order System Looping Issue?


I am designing an online ordering system for a restaurant. I have a menu with check boxes by each item where the customer can select which items they desire. The menu is located at

The problem is that when the order is processed I need it to store each checked off item as a session variable. In the following code, it only selects the first item checked and not the rest if there is more than one. Any help is appreciated!

foreach ($item as $itemname)
$query = mysql_query("SELECT * FROM `menu` WHERE title = '$itemname'");
	while($row = mysql_fetch_array($query)) {
		$total = $total + $row['price'];
echo "<p>" . $row['title'] . " - <span style=color:#000;>$" . $row['price'] . "</span></p>";

$allitems = $row['title'] . $row['price'];

$_SESSION['items'] = $allitems;
$_SESSION['total'] = $total;


$_SESSION[‘items’] = $allitems;

it simply outputs the word Array when I tried that

To see what is in an array do ;

print_r($array) ;


var_dump( $array ) ;

The latter is better because it shows you both the type and the value.