Jump to content

[SOLVED] date_FORMAT Need to convert back to MySQL Date Format


dlebowski

Recommended Posts

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"; 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.