Hi, I am having two mysql tables "table1" and "table2". I want to delete the table1's records. At the same time, the deleted records from table1 should be inserted into table2. How cai i do this? Anybody help me please?
thanks in advance.
One way to do it, is to loop through the first table and for every record, you insert it in the second table and then delete it in the first one.
You could also just insert it and in the end remove the whole first table. (DROP TABLE)
You could also use phpMyAdmin to achieve this very easily using the "Operations" tab on the the first table. This gives you an option to copy the data from one table into another table. Once this is done you can remove the first table.