Phpmysql data insertion from an array to mysql table using php

hi

i am new to php and need help regarding array insertion into mysql table

i have an array when i add and item to the shopping cart

$_session[‘cart_array’] = array(“item_id” => $pid, “quantity”=>1)
now if i have one item in cart when i do print_r($_session[‘cart_array’]) array looks like

Array( [0] => Array ( [item_id] => 1 [quantity] => 1 ) )
now i need to insert this array data to a table named purchased_products having columns

id, product_name, product_quantity
please help me out its urgent

thanks

You loop through the array, create the query string, and execute the query.
Some pages from the manual that might help you out:
http://www.php.net/foreach
http://www.php.net/mysql_query