I am currently facing the following dilemma....
I have two tables, the first one is used to keep customer information and the second uses the customer ID.
Problem: When I add a customer to the database the ID is set to be automatically incremented within the MySQL database but I need to add this customer ID into the second table.
For example:
$query = ("INSERT INTO storage_customer (unitn, date, lname, laddress1, laddress2, lphone, ldob, ldln, lssn, le, mrent, sd, pt, ptb, items, cou, dpl, misc)
VALUES('$d1', '$d2', '$d3', '$d4', '$d5', '$d6', '$d7', '$d8', '$d9', '$d10', '$d11', '$d12', '$d13', '$d14', '$d15', '$d16', '$d17', '$d18')");
$r1 = mysql_query($query);
$query = "UPDATE storage_units SET cid = '!!!NEED CUSTOMER ID HERE!!!' WHERE unumber = $id";
$r2 = mysql_query($query);
Should anyone have any suggestions on how to get the customer ID in there or a better way to get the same results it would be most helpful!
Abarak
Should you require farther information please ask....