"; $query_result_handle = mysql_query ($query); } } else { //if it is the first transaction,insert the data //echo "additem is".$additem; $itemstr="cartitem[]=".$additem."-".$itemtype; $thisdate= date("Y-m-d"); $query="INSERT INTO carts (client,items,insdate) VALUES (\"$client\",\"$itemstr\",\"$thisdate\")"; //echo $query; $query_result_handle = mysql_query ($query); } } } $stype="check1"; } $view="cart"; /* * Requests from navigation column */ if($type) { $query="SELECT catalog_id,title,price,artist,mp3price FROM songs WHERE catalog_id='$type'"; $query_result_handle = mysql_query ($query); for ($count = 1; $row = mysql_fetch_row ($query_result_handle); ++$count) { $thumb=""; parse_str($row[3]); if ($itemtype=="MID") $cost=sprintf ("%01.2f", $row[2]); else $cost=sprintf ("%01.2f", $row[4]); } } /* * Inclusion script which handles: * > View cart contents * > Update quantities * > Checkout */ include("cartjob.php"); ?>