Is there an easy way to copy parent records and all related child records using strictly SQL without using cursors or external scripts / code? Here is an example of what I have:
categories
==
category_id
category_name
parent_table
==
parent_record_id
category_id
... <other fields>
child_table1
==
child_table1_id
parent_record_id
... <other fields>
child_table2
==
child_table2_id
parent_record_id
... <other fields>
, . , , , auto_increment. , , category_id. parent_table, - category_id category_id, . parent_record_id child_record1 child_record2.
, , PHP . ?