Related Articles You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY pubdate DESC LIMIT 5' at line 5 SELECT *, DATE_FORMAT(pubdate, '%W, %e %M %Y at %H:%i:%s') AS fpubdate FROM articles WHERE id!= ORDER BY pubdate DESC LIMIT 5