Page 1 of 1
How can I move data (a row) from table A to table B?
Posted: Sat Apr 12, 2003 7:11 am
by Erick020
I need to move the displayed informations (echo from a "select querry") to an other table (a similar one - archive).
who can help me ?
Thanks a lot,
Erick.
Posted: Sat Apr 12, 2003 7:12 am
by twigletmac
Posted: Sat Apr 12, 2003 7:29 am
by Erick020
Thanks for your answer.
I guess I'm not good enough for that kind of stunt! .... I tried, and I get a "Supplied argument is not a valid MySQL result resource".
Could you please supply a more specific exemple?
I need to move let say: user_id, date1, date2, F1, F2 from table_A to table_B - the data in table_A must be deleted after moving to table_B
and of course the 2 tables structure are similar.
Posted: Sat Apr 12, 2003 12:48 pm
by twigletmac
Could you post the code you tried so we can help you debug it?
Mac
Posted: Sat Apr 12, 2003 7:40 pm
by Erick020
twigletmac wrote:Could you post the code you tried so we can help you debug it?
Mac
Thanks for you proposition. I guess I get it worked now. I first SELECT*, then INSERT INTO table_B and then DELETE FROM table_A.
It works, even if this not the "right method" to do it !
I still have a small problem... It doesn't want to move the "SPACE" sign. that means, if I have : test tes1, it will move only : test.
Any idea?
Thanks,
Erick.
Posted: Sun Apr 13, 2003 11:54 am
by twigletmac
Again, if you post your code it is a lot easier to help because we don't have to guess at what's going wrong.
Mac