dlebowski Posted October 23, 2007 Share Posted October 23, 2007 Hello. I am running this query below to show only events happening today and forward: SELECT date_FORMAT(AuctionDate, '%M %e, %Y') as newdate, AuctionDescription, AuctionTitle, AuctionDate, AuctionTime, AuctionAddress, AuctionCity, AuctionState, AuctionCity, AuctionZip FROM auctions WHERE AuctionDate >= NOW() ORDER BY AuctionDate For some reason, it only shows values for events GREATER than today. So today's events are not showing up. It used to work and now it doesn't. I recently changed from PHP 4 to PHP 5. Is there something I need to change with ">= NOW()"? That is the only think I can think of. Any suggestions? I did confirm that the time on my server is correct. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/74479-solved-php-now-issue/ Share on other sites More sharing options...
Daniel0 Posted October 23, 2007 Share Posted October 23, 2007 This is strictly SQL, so the problem has nothing to do with the upgrade? Do you get any errors? Quote Link to comment https://forums.phpfreaks.com/topic/74479-solved-php-now-issue/#findComment-376367 Share on other sites More sharing options...
SammyGunnz Posted October 23, 2007 Share Posted October 23, 2007 Just curious...what format are you storing your AuctionDate in? Quote Link to comment https://forums.phpfreaks.com/topic/74479-solved-php-now-issue/#findComment-376368 Share on other sites More sharing options...
dlebowski Posted October 23, 2007 Author Share Posted October 23, 2007 Here is what I ended up doing to get this to work. (By the way, I recently upgraded my version of mysql as well) So there must be something that doesn't jive in the new version of mysql in regards to NOW(). Here is what I did to get around it: $date = date("Y-m-d"); SELECT date_FORMAT(AuctionDate, '%M %e, %Y') as newdate, AuctionDescription, AuctionTitle, AuctionDate, AuctionTime, AuctionAddress, AuctionCity, AuctionState, AuctionCity, AuctionZip FROM auctions WHERE AuctionDate >= '$date' ORDER BY AuctionDate Quote Link to comment https://forums.phpfreaks.com/topic/74479-solved-php-now-issue/#findComment-376375 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.