newprogram Posted January 24, 2011 Share Posted January 24, 2011 I have a mysql database with close to 30,000 records "members user login info" each record has a row called "lastlogin" which records the last time the user login I need to go throw the table and if the lastlogin is not from 20100101 to 20110124 then delete the record. Quote Link to comment https://forums.phpfreaks.com/topic/225574-delete-records-in-table/ Share on other sites More sharing options...
kickstart Posted January 24, 2011 Share Posted January 24, 2011 Hi DELETE FROM table WHERE lastlogin < 20100101 However that will depend on what format the date is (the above assumes a normal integer storing the date, which is unlikely). Is it a timestamp? Oh, and back up the table before you do anything like this. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/225574-delete-records-in-table/#findComment-1164775 Share on other sites More sharing options...
newprogram Posted January 25, 2011 Author Share Posted January 25, 2011 no the date is in this format 20100101 which is year 2010 month 01 day 01 Quote Link to comment https://forums.phpfreaks.com/topic/225574-delete-records-in-table/#findComment-1164801 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.