December 31, 201213 yr Just a quick question does wamp server support GETDATE() function? I am trying to delete any records from my database that are 1 day old using.. mysql_query("DELETE FROM table WHERE date < GETDATE()-1"); should work right?
December 31, 201213 yr Author getdate isn't a mysql function. I think the one you need is curdate() Seem to be on the right lines now. mysql_query("DELETE FROM table WHERE date < DATE_ADD(CURDATE(), INTERVAL -1 DAY);"); works
Create an account or sign in to comment