Page 1 of 1

MySQL move record from one table to another

Posted: Tue Sep 06, 2005 3:55 am
by Crew
Hi Guys

I have the ID of the record i want to move from one table to the other but I do not know how to transfer it. There must be a simple way other that selecting everything from the first table, making them into variables, inserting into the second then deleting the first.

I've had a look at SELECT * INTO $helpdesk_submission FROM $helpdesk WHERE id='$id' but this does not seem to work, or is not compatable with MySQL.

I'm using MySQL 4.0.20

Thanks for any ideas you may have

Posted: Tue Sep 06, 2005 4:00 am
by feyd

Posted: Tue Sep 06, 2005 4:26 am
by Crew
ok so now I have

INSERT INTO test_helpdesk SELECT test2_helpdesk.* FROM test2_helpdesk

how do i get the ID to auto increment and start from the next ID int he table test_helpdesk. There are a lot of columns in test2_helpdesk so is there an easy way?