This is something I've been meaning to figure out once and for all.
I have a field in a mySQL table 'Date_Added', of timestamp format, and is set to add in athe current time when a new record is added.
This natively outputs as
2006-12-06 08:35:15
So I'm trying to convert it to either 06-12-2006 or 6th December 2006.
My current query looks like
"SELECT * FROM Keywords INNER JOIN (Photos INNER JOIN PhotoKeywords ON Photos.Photo_ID = PhotoKeywords.Photo_ID) ON Keywords.Keyword_ID = PhotoKeywords.Keyword_ID WHERE Photos.Photo_ID = %s
ORDER BY Keyword ASC"
Where Date_Added is a field in the table 'Photos'
So I'm trying to add in something like :
date_format(Date_Added, '%a %D %b %Y') as formatted_date from Photos;
to the query
and change the echo from
<?php echo $row_PhotoSimple['Date_Added']; ?>
to
<?php echo ['formatted_date']; ?>
or similar.
I've tried just about every permutation with these bits of codes, but can't quite seem to get the syntax correct.
Can anyone let me know where I'm going wrong?