Coming off an add-to page:
$cart=array();
$cart['sku']=$_GET['sku']; // or POST, up to you & your app
$cart['quan']=$_GET['quan'];
$query="select price from catalog_items where sku=".$_GET['sku']; // don't trust price to GET or POST
do the db stuff for that. When you've got a complete array,
$_SESSION['cart'][]=$cart ;
You get into a few nested loops this way, but it's effective.