0

is it possible to move one table column data to another column data after 1 or 2 days i mean like we have one table which is called table1 another table is table2 table1 have some data like name contact postal address then how to move all of data from table1 selected row to table2 after a period i mean one or two and when table1 data have move to table2 it will be delete from table1 . in more details like we insert data into table1 like entry_day column using now() we get current date is there any option to after 1 days or 2 days the data will delete from tbl1 and insert into tbl2

$q= "INSERT INTO table1 (name,contact,postal,entrydate) values ('".$row[0]."','".$row[1]."','".$row[3]."',now())";

Oswald
  • 31,254
  • 3
  • 43
  • 68
user3728517
  • 157
  • 3
  • 10
  • 1
    Don't forget to use the search before creating a new question as it most likely already have an answer to, duplicate of [How to store day to day records from a mysql table to another?](http://stackoverflow.com/questions/13926615/how-to-store-day-to-day-records-from-a-mysql-table-to-another) and [mysql move row between tables](http://stackoverflow.com/questions/5420156/mysql-move-row-between-tables?rq=1) and [Move from one table to another](http://stackoverflow.com/questions/6767593/move-from-one-table-to-another?rq=1) – Prix Aug 24 '14 at 09:49
  • thanks i will check from next time thanks again for your comment – user3728517 Aug 24 '14 at 15:22

1 Answers1

0

Just create a MySQL event to handle this based on the entrydate. Its quite easy and a quick google search will turn up plenty of information on how to create them.

Kirk Logan
  • 733
  • 2
  • 8
  • 23