conan318 Posted October 14, 2011 Share Posted October 14, 2011 still shows all records in the database... any idea how i go about this? $date= date('y-m-d'); $query=mysql_query("SELECT * FROM listing WHERE date >= $date") or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/249094-show-records-greater-then-todays-date-help/ Share on other sites More sharing options...
Drummin Posted October 14, 2011 Share Posted October 14, 2011 $date= date('y-m-d'); $query=mysql_query("SELECT * FROM listing WHERE date>='$date'") or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/249094-show-records-greater-then-todays-date-help/#findComment-1279233 Share on other sites More sharing options...
conan318 Posted October 14, 2011 Author Share Posted October 14, 2011 iam using the date field with the date being displayed as 2011-09-13 after checking the field is called expire_date. but still no luck $date= date('y-m-d'); $query=mysql_query("SELECT * FROM listing WHERE expire_date>='$date'") or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/249094-show-records-greater-then-todays-date-help/#findComment-1279234 Share on other sites More sharing options...
Drummin Posted October 14, 2011 Share Posted October 14, 2011 And I assume you have records in your listing table with the expire_date greater than 2011-09-13. I once had an issue with using underscore in a field name where it wasn't picking up the second half of the name. You might try changing the field name to `expiredate`and see how that works. Hey, it's a thought. Quote Link to comment https://forums.phpfreaks.com/topic/249094-show-records-greater-then-todays-date-help/#findComment-1279236 Share on other sites More sharing options...
PFMaBiSmAd Posted October 14, 2011 Share Posted October 14, 2011 The date() format string should be 'Y-m-d' Quote Link to comment https://forums.phpfreaks.com/topic/249094-show-records-greater-then-todays-date-help/#findComment-1279238 Share on other sites More sharing options...
conan318 Posted October 14, 2011 Author Share Posted October 14, 2011 topic solved once again thanks guys $date= date('Y-m-d'); $query=mysql_query("SELECT * FROM listing WHERE expiredate>='$date'") or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/249094-show-records-greater-then-todays-date-help/#findComment-1279254 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.