$query3 = mysql_query("SELECT DATE_FORMAT(date, '%M %D %Y') FROM post WHERE postid='$postid'"); $dategrab = mysql_fetch_assoc($query3); $date = "$dategrab[date]";
$date is empty. What do I need to do to print out the date?
$query3 = mysql_query("SELECT DATE_FORMAT(date, '%M %D %Y') FROM post WHERE postid='1'"); $date = mysql_fetch_row($query3); echo $date[0];
Thanks. So I assume when you format the date the mysql_fetch_assoc returns something other then the column name? Or just nothing at all?
mysql_fetch_assoc will return the values as column names and row numbers, but that query doesnt have a name returned so its better to use fetch_row. you could add AS somefield to it and then it will have a name.