Here is my sql statement
SELECT (DATE_FORMAT(MAX(date_posted), '%e-%m-%Y')AS date_posted), type FROM post p, types t WHERE userid='$user_id' AND p.typeid=t.typeid
But it doesn't work. It doesn't give an error either.
Try echo'ing a mysql_error() after your query syntax.
echo mysql_error();
-WeAz
SELECT (DATE_FORMAT(MAX(date_posted), '%e-%m-%Y') AS date_posted)
should really be
SELECT (DATE_FORMAT(MAX(date_posted)), '%e-%m-%Y') AS date_posted
Otherwise, you are applying the '%e-%m-%Y' format to the MAX statement.
take care of your parentheses.
(DATE_FORMAT(MAX(date_posted)), '%e-%m-%Y') AS date_posted
The DATE_FORMAT(date, transofrmation) it's the right.