almost got profile and orders

i think the problem is in checkout.php line 20. i want to put the
orders in the database. I think i need 2 foreach statements to do this.