spraypray12 Posted April 26, 2007 Share Posted April 26, 2007 Right now i have a form like this: www.redmond.k12.or.us/rhs/php/orderform/form.php I have a table with these columns: Date,Requestor,Student_Body,District,Grant_or_Other,Vendor_Name,Address, Address_Line_2,Phone,Fax,q1,q2,q3,q4,q5,q6,c1,c2,c3,c4,c5,c6,d1,d2,d3,d4,d5,d6,p1, p2,p3,p4,p5,p6,e1,e2,e3,e4,e5,e6,Shipping_Estimate,Total I want to split into something like this: order_desc id date requestor student_body district grant_or_other vendor_name addr1 addr2 phone fax order_items id order_id quantity catalog desc price ext_price I want to be able to submit each row of data in the bottom part of my form to the order_items table, but i don't know how to relate them to the order_desc table. Also, i don't know how i would keep the order_id the same for each row, for that query. Any help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/48827-nomalizing/ Share on other sites More sharing options...
bubblegum.anarchy Posted April 26, 2007 Share Posted April 26, 2007 Insert the order_desc table information first and store the last insert id like this: $order_id = mysql_insert_id(); Then insert each order item table information with order_id set to $order_id. Link to comment https://forums.phpfreaks.com/topic/48827-nomalizing/#findComment-239399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.