bit of a newb question but i couldn’t really find the answer online…
if i’m calling something that’s a date data type… displaying the date of a post for example… how do you customize how it displays that? by default it seems to put it like “2010-03-12 15:05:47” when using [‘post_date’] how do i modify that call (not sure on right terminology here) so that it will display say March 12, 2010 instead?
If you are going to use that then since it is SQL and not PHP you need to place it in the select statement.
$newsstring = "SELECT post_id,post_title,DATE_FORMAT('post_date', '%W %M %Y %H:%i') as postdate,post_author,post_content,post_category FROM tbl_posts ORDER BY post_date DESC";
FYI to have MySQL do the conversion your query would look like this:
SELECT post_id, post_title,
DATE_FORMAT(post_date, '%W %M %Y %H:%i') AS post_date,
post_author, post_content, post_category
FROM tbl_posts ORDER BY post_date DESC
There are no quotes around post_date as you’re referring to the table column, not passing in a string value.