guyfromfl Posted April 9, 2007 Share Posted April 9, 2007 There was a post similar to this one but I can't find it right now All this is to do is get rid of past concerts if it is before today. I do have DELETE privelege for the user $today = date("Y-m-d"); // Delete past events $sql = "DELETE FROM tbl_events WHERE eventDate < '$today')"; $query = mysql_query($sql); no clue why it doesnt work Link to comment https://forums.phpfreaks.com/topic/46292-solved-delete-past-events-from-phpmysql/ Share on other sites More sharing options...
Caesar Posted April 9, 2007 Share Posted April 9, 2007 What format are your dates in "eventDate" stored as? Link to comment https://forums.phpfreaks.com/topic/46292-solved-delete-past-events-from-phpmysql/#findComment-225225 Share on other sites More sharing options...
per1os Posted April 9, 2007 Share Posted April 9, 2007 // Delete past events $sql = "DELETE FROM tbl_events WHERE eventDate < '$today'";//had an extra paran here un needed $query = mysql_query($sql) or DIE(mysql_error()); // using that would of showed you the error Link to comment https://forums.phpfreaks.com/topic/46292-solved-delete-past-events-from-phpmysql/#findComment-225226 Share on other sites More sharing options...
guyfromfl Posted April 9, 2007 Author Share Posted April 9, 2007 i had the die statment earlier removed it to work on parts of code after. deleteing the ) didnt fix it. the date info i inserted was 2007-04-09 and in the create table statment i just defined the data type ad date() Link to comment https://forums.phpfreaks.com/topic/46292-solved-delete-past-events-from-phpmysql/#findComment-225231 Share on other sites More sharing options...
per1os Posted April 9, 2007 Share Posted April 9, 2007 Thats your problem, the date is in the wrong format. I would try a unix time stamp and see. $today = time(); // Delete past events $sql = "DELETE FROM tbl_events WHERE eventDate < '$today'"; $query = mysql_query($sql) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/46292-solved-delete-past-events-from-phpmysql/#findComment-225239 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.