in reply to (OT) Removing something from MySQL table based on time

Whenever you're writing a query that's going to do a DELETE, it's always a good idea to write it as a SELECT first, just so that you can see exactly what it is that will be deleted. This is especially true with mysql, as there is no ROLLBACK function - so unless you've backed up your data you only have one chance to get it right.

So taking your example, I'd do:

SELECT FROM day_time WHERE lasttime < "$timeday";

and see what that returns.

Also agree with the suggestions re using mysql date functions.

-- Darren
  • Comment on Re: (OT) Removing something from MySQL table based on time