0

is it possible to move one mysql table data to another table after 1 or 2 days like we have 2 table one is tbl1 another one is tbl2 tbl1 contain column uname and performance i want to move uname and performance data in to tbl2 after 2 or 3 days how t o do that

3
Contributors
6
Replies
56
Views
3 Years
Discussion Span
Last Post by diafol
0

yah it is possible, but u said after one days or two days, but does not describe after one days or two days of what, means after registration, after activation or of there payment, i am assuming it can be any thing, you can do some thing like this

$day=current_date-registration_date

if($day>2)
run your query to get this informatin from table1,
run your query to insert it in the table2,
run your query to delete that value from table1,

job done its just a structure not the code, and there other complication too, unless you provide some code here, it will be very hard for others to help you out,

thanks

0

sorry for the late response i was sick thats why can't post the code is here i am ok with this i can find the event and it work as i expected but there are also a problem a cripy problem actually that is my event name is't change ramdomly , accorrding to my code is should not be so how to change event name ramdoly any suggestion ..

$insertquery="CREATE EVENT JOY
    ON SCHEDULE  AT CURRENT_TIMESTAMP + INTERVAL 3 MINUTE
    DO
      BEGIN
       insert into course_finish (course_id, username, course_name) select username,course_name,course_id from course_entry where username = '".$user."';

delete from course_entry where username = '".$user."';
0

Alternatively if you want to run a routine at regular intervals, you can set CRON JOBS to run a php script at a particular time / interval.

0

I have no idea what you mean. You want to run a routine at random intervals?

sorry for the late response i was sick thats why can't post the code is here i am ok with this i can find the event and it work as i expected but there are also a problem a cripy problem actually that is my event name is't change ramdomly , accorrding to my code is should not be so how to change event name ramdoly any suggestion ..

This makes little sense to me. I imagined that you wanted to run an 'archive' type routine that moved records from one table to another on a regular-ish basis.

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.