Hey Guy's,anyone has a working codes of my problem?

moving row data table to another table using php/mysql

sorry guy's for this cause i'm very noob on this php/mysql language

any help would be appreciated(i'm reallly badly need your help)

5 Years
Discussion Span
Last Post by vibhaJ

You need to send a row of data from a mysql database to another?
Can you give an example of what are you tring to achieve so I can help you?


From the member rules:

Do provide evidence of having done some work yourself if posting questions...

Show your code so far...


thank you dany12

i have a 2 table name is "original" table,then the second is "archieve" table..

i have 4 fields in the "original" table..

id_number (space) fullname (space) status (space) address

-001234 (space) romel barrio (space) student (space) california (space) (button link command)--> "move in archieve"

after i click the "move in archieve"

it should transfer the 001234,romel,student,california in the "archieve" table,,then also delete data from original table

that's all.

hope you understand..:}

Edited by breakzzzz20: not understandable



I found on the net the following syntax to copy rows from table1 to table2:

    INSERT INTO table2 SELECT col1, col2, col3  FROM table1 WHERE condition

Then, you can apply a DELETE command on table1 with the same condition.

Edited by MarPlo


Hi breakzzzz20, Its worked for me try this,

INSERT INTO trash_table (date, time, ip) SELECT t1.date, t1.time, t1.ip from messages t1 WHERE t1.id = '1';

DELETE FROM messages WHERE id = '1';

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.