View Full Version : Insert Error - Foreign key

03-11-2013, 07:12 PM
0 0 0 0 0 0

03-11-2013, 08:21 PM
Yep, you guess correct.
Insert into the customer, capture the id used by issuing a mysql_insert_id(), do the same with the computer (make sure you issue a query call though as neither of these two currently do). Then take each of those, and use them as the necessary values in the contract during the insertion.

Also, mysql library is nearing EOL; you should consider using mysqli or PDO for your mysql work. Since the current code you have is susceptible to sql injection, you should look at using prepared statements for the mysqli or pdo library and go from there.