1064: 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 'where xpublish='yes' and right(xpics,3)='jpg' and right(xpic,3)='jpg' and fcateg' at line 1