hugeness Posted May 27, 2010 Share Posted May 27, 2010 hello i have a frightening mash up of a database for users.. due to my inability and due to having to run on a Joomla CMS (makes simple php tricky) because of this, i have one form that inserts new records rather than updating existing ones.. the only way i can see to work around this is to run a regular housekeeping cron job on the table to delete any record where a user has more than one record, by whichever is oldest (the table is timestamped) so far i have something like DELETE * FROM tablename ORDER BY timestamp ASC LIMIT 5; this will delete the previous 5 records.. but thats not neat enough for the table, how do i do a count then delete all but the newest one? thank you Link to comment https://forums.phpfreaks.com/topic/203149-housekeeping-cron-job-leaving-just-the-newest-1-entry-per-userid/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.