|
-
Jun 1st, 2006, 04:35 PM
#1
Thread Starter
Frenzied Member
php sql
is there a way i can move a record from 1 table to another?
both tables have the same table structure wth the same fields..
do i have to do it the long way? i.e..
grab all items from table1
insert into table2 .....
or is there a quicker way?
-
Jun 1st, 2006, 04:40 PM
#2
Re: php sql
You can run a few simple SQL statements to do this.
INSERT INTO Table2(field1,field2,field3,field4)
SELECT T1.field1,T1.field2,T1.field3,T1.field4 FROM Table1 T1 WHERE T1.field1 = 29385
Then,
DELETE FROM Table1 WHERE T1.field1 = 29385
HTH
-
Jun 1st, 2006, 05:35 PM
#3
Thread Starter
Frenzied Member
Re: php sql
 Originally Posted by mendhak
You can run a few simple SQL statements to do this.
INSERT INTO Table2(field1,field2,field3,field4)
SELECT T1.field1,T1.field2,T1.field3,T1.field4 FROM Table1 T1 WHERE T1.field1 = 29385
Then,
DELETE FROM Table1 WHERE T1.field1 = 29385
HTH
awesome reply, perfect.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|