updating table1 then table2 issues
Posted: Thu Jun 10, 2010 6:51 pm
I am new to PHP and i am having some difficulties hitting table1 then table2.
I have checked many forums and still cant resolve this issue.. here is my code...
Here is my 1st table and i am inserting the 'id'..... I need this id to populate the 'OrderNumber' field in Table 2..
I think it should be something simple, but with my limited knowledge i am not able to get it to connect without error..
Thanks in Advance.!@!
I have checked many forums and still cant resolve this issue.. here is my code...
Here is my 1st table and i am inserting the 'id'..... I need this id to populate the 'OrderNumber' field in Table 2..
I think it should be something simple, but with my limited knowledge i am not able to get it to connect without error..
Code: Select all
$query= "insert into orders(id, dt) VALUES ('NULL','".$DT."')";
mysql_query ($query) or die ('1st query');
for ( $counter = 1; $counter <= 4; $counter += 1) {
if ($_POST["qty".$counter] > 0){
$query="INSERT INTO item(uID, OrderNumber, item_sku, qty, DT,)VALUES
('".$RouteNumber."','NULL','".$_POST ["SKU".$counter]."','".$_POST ["qty".$counter]."','".$DT."')";
mysql_query ($query) or die ('Error updating database');
}}Thanks in Advance.!@!