ohdang888 Posted March 26, 2008 Share Posted March 26, 2008 How do i compare dates... for example... This is what i want to do $last = $row['time']; mysql_select_db("comments") or die(mysql_error()); //this query is comparing dates.... $result = mysql_query("SELECT COUNT(id) FROM `game_comments` WHERE `com_date` IS AFTER '{$last}' ")or die(mysql_error()); $row = mysql_fetch_array($result); $count = $row['COUNT(id)']; Thanks Link to comment https://forums.phpfreaks.com/topic/97906-compare-dates/ Share on other sites More sharing options...
soycharliente Posted March 26, 2008 Share Posted March 26, 2008 I'm fairly sure you can just use < or > to compare dates in MySQL if they are data or datetime data types. <?php $sql = "SELECT COUNT(id) FROM `game_comments` WHERE `com_date` > '{$last}' "; ?> Link to comment https://forums.phpfreaks.com/topic/97906-compare-dates/#findComment-500999 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.