i'm trying to pull the several most recent date, entry, and author values from a mysql database. basically, php isn't recognizing my statement as a proper query. but if i paste the same code into an sql interface (phpmyadmin, or just mysql) it works fine. anyone have any idea? here's the code below:
$query = "SELECT concat (dayname (postdate), ', ', monthname (postdate), ' ',
dayofmonth (postdate), ', ', year (postdate))
AS post_date,
concat (date_format (postdate, '%l:%i %p'))
AS post_time,
entry, author
FROM weblog
ORDER BY post_date ASC
LIMIT 8";
$result = mysql_query ($query);
for the sake of avoiding the problems i am currently using:
$query= "SELECT postdate, entry, author
FROM weblog
ORDER BY postdate ASC
LIMIT 8";
but that, as you can tell, returns the default timestamp format, which is unusable (YYYYMMDDhhmmss)
by the way, here are the variable types:
thanks.