darksniperx Posted March 19, 2008 Share Posted March 19, 2008 I have 2 tables in my database, hourlyUpdates and archiveUpdates. I would like to create a php script that would cut the data from hourlyUpdates table and append it to archiveUpdates table. The main question is how can I cut the data to be sure that i have removed only exactly what was select statment. For example, hourlyUpdates table has data a,b,c I append the data to archiveUpdates, by the time append has finished hourlyUpdates has a,b,c,d data. When I remove the data I need to be that I remove only what I have copied. Quote Link to comment https://forums.phpfreaks.com/topic/96946-cut-data-from-one-table-and-append-it-to-another-table/ Share on other sites More sharing options...
fenway Posted March 19, 2008 Share Posted March 19, 2008 Why go through all the hassle? Quote Link to comment https://forums.phpfreaks.com/topic/96946-cut-data-from-one-table-and-append-it-to-another-table/#findComment-496229 Share on other sites More sharing options...
darksniperx Posted March 20, 2008 Author Share Posted March 20, 2008 Why go through all the hassle? hourlyupdate is the one where has tons of data being added to, and archiveUpdates is the one that users read to check their stats. my hourly update got too much records so its killing my db. Quote Link to comment https://forums.phpfreaks.com/topic/96946-cut-data-from-one-table-and-append-it-to-another-table/#findComment-496489 Share on other sites More sharing options...
teng84 Posted March 20, 2008 Share Posted March 20, 2008 1. select all the data on that given period 2. insert that in your db 3. check if has been successfully added 4. delete all those added data on your 1st table( if data has been added successfully on step 3) hmm.... Quote Link to comment https://forums.phpfreaks.com/topic/96946-cut-data-from-one-table-and-append-it-to-another-table/#findComment-496524 Share on other sites More sharing options...
darksniperx Posted March 20, 2008 Author Share Posted March 20, 2008 I will delete by date then, I guess that is the easiest thing. Quote Link to comment https://forums.phpfreaks.com/topic/96946-cut-data-from-one-table-and-append-it-to-another-table/#findComment-496668 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.