nubble Posted November 17, 2006 Share Posted November 17, 2006 Can't seem to get this bugger working. I'm trying to display the date as M d Y - but it just keeps showing up as Y M d on my php page.I'm using $sql = "SELECT `snakeID`, `date`, `weight`, DATE_FORMAT(date, '%M %d %Y') FROM `weights` WHERE `snakeID` LIKE '$critter' ORDER BY date DESC";and here's the page - as you can see, not working so good :([url=http://sprucenubblefarm.com/chondros/TI05J01_weights.php]http://sprucenubblefarm.com/chondros/TI05J01_weights.php[/url]I am pretty new at this, I'm sure I'm doing something retarded.Any help would be great!Amy Link to comment https://forums.phpfreaks.com/topic/27608-issues-with-date_format/ Share on other sites More sharing options...
esukf Posted November 17, 2006 Share Posted November 17, 2006 Try[code]$sql = "SELECT `snakeID`, `weight`, DATE_FORMAT(date, '%M %d %Y') AS `date` FROM `weights` WHERE `snakeID` LIKE '$critter' ORDER BY date DESC";[/code]You are pulling 2 dates from youe select statement. I'm guessing you are using $row['date'] which is the unformated date from your select. Link to comment https://forums.phpfreaks.com/topic/27608-issues-with-date_format/#findComment-126257 Share on other sites More sharing options...
nubble Posted November 17, 2006 Author Share Posted November 17, 2006 Thank you SOOO much. I would have been at it for days trying to figure that out. Sweet :) Link to comment https://forums.phpfreaks.com/topic/27608-issues-with-date_format/#findComment-126262 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.