[eluser]andriu[/eluser]
Hi guys
I'm stuck on a sql query
Perhaps some has an idea.
I want to copy a record i "table1":
Code:
INSERT INTO table1(name, price, etc.)
SELECT name, price, etc. FROM table1
WHERE table1.record_id =13
Then I want to copy the records in "table2" related to table1.id = 13
but obvoiusly change these records record_id to the record_id of the new entry in table1.
Code:
Table 2:
id table1_id description etc.
1 13 some text
Is there a way to do this in one query =)?? Or am I trying to overdo it and better of doing it with php.
Thanks for any help