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 'AND story2cat_link.storyCatLinkStoryID=news.rel_ID ORDER BY news.rel_releaseDat' at line 1SELECT news.*, DATE_FORMAT(news.rel_releaseDate,'%D %M %Y') AS niceDate FROM news , story2cat_link WHERE news.rel_showFromNOW() AND story2cat_link.storyCatLinkCatID= AND story2cat_link.storyCatLinkStoryID=news.rel_ID ORDER BY news.rel_releaseDate DESC LIMIT 0, 5