I would like to use two different insert statements with two different tables such as
<?
mysql_query("INSERT INTO Customer (ID,Name,Subject, OrderDate) VALUES ('$ID', '$name', '$status', '$ODate')");
mysql_query("INSERT INTO Order (ID,Subject, Department, Status, OrderDate, Receive, Notes) VALUES ('$ID', '$status', 'Financial', 'Financial Department', '$ODate', 'NO', 'Notes')");
?>
It just works with the first table and does not work with the second table.
Can some one help solving this problem?
Thanks
You need to check for errors:
I’m guessing you are getting an error because
Orderis a reserved word in MySQL and should be escaped accordingly:It also seems to me like you’re inserting a fixed value as a primary key – are you sure that’s what you want?
As I said in the comments, you should stop using
mysql_functions completely and use MySQLi or PDO instead.