Reputation: 21
I have two tables 'order' & 'new-order', i need to add same values in both these table by using a single line of code.
My code is as follows:-
/To add value in first Table/
mysql_query("insert into
order
(display, project, keyword) values ('$cname','$pro','$kwrd')");
/To add same value in second Table/
mysql_query("insert into
neworder
(display, project, keyword) values('$cname','$pro','$kwrd')");
Now can i use some thing like this:-
mysql_query("insert into
order
&&neworder
(display, project, keyword) values ('$cname','$pro','$kwrd')");
and if not then what should be the correct one.
Upvotes: 1
Views: 47
Reputation: 626
You can read more about it from the MySQL Manual. In short, you cannot insert into multiple tables at once. This leaves you with three options:
INSERT
statementsUpvotes: 2