Welcome Guest, Not a member yet? Register   Sign In
MySQL Query help
#2

[eluser]@rno[/eluser]
Hi Andriu,

The simple answer is: No.
You cannot insert into two tables at once.
But if you want (as I assume you do) insert all related records in table2 at once than the answer is yes.
You could create a simple sql that says:

Code:
INSERT INTO Table2 (table1_id, description)
SELECT YOUR_NEW_ID_HERE, description FROM Table2 WHERE table1_id = 13

obviously you need to replace the YOUR_NEW_ID_HERE with the newly created ID from table1

Good luck!

Arno


Messages In This Thread
MySQL Query help - by El Forum - 10-23-2009, 03:02 PM
MySQL Query help - by El Forum - 10-23-2009, 04:47 PM
MySQL Query help - by El Forum - 10-24-2009, 07:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB