Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 2 tables one is sign up second is login i want to insert data both tables simultaneously mean using single query data insert in 2 tables.
Posted

AFAIK, for single insert there can be only one insert statement. Single insert statement cannot insert in two tables, however, you can create an insert Trigger on Signup table for login table.

So when the data is inserted in Signup table, it will automatically fire insert in login table.
 
Share this answer
 
you can not insert records in two tables with a single insert query, you can use trigger as suggested by Amit or can refer this:

http://www.hiteshagrawal.com/mysql/mysql-batch-insert-using-php[^]

hope this helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900