dlebowski Posted August 25, 2007 Share Posted August 25, 2007 Below is a couple of snippets of code that I have for modifying the date format from MySQL and it works great. The problem I am running into is later in the code I need to call the $AuctionDate variable to query the data field in another table. This won't work because the format has been modified using date_FORMAT. How do I convert it back to the MySQL date format so I can properly query the database. Thank for your help as usual! Query converting MySQL date format: $query="SELECT date_FORMAT(AuctionDate, '%M %e, %Y') as newdate, AuctionDescription, AuctionTitle FROM auctions WHERE AuctionDate >= NOW() ORDER BY AuctionDate"; $AuctionDate=mysql_result($result,$i,"newdate"); Need to change $AuctionDate back to MySQL date format for the query below: $query="SELECT AuctionImageDate FROM AuctionImages WHERE AuctionImageDate=$AuctionData"; Quote Link to comment https://forums.phpfreaks.com/topic/66641-solved-date_format-need-to-convert-back-to-mysql-date-format/ 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.