query: SELECT i.id, i.sold, i.category, c.name, i.title, i.mad, i.featured FROM item i, category c WHERE c.id= AND c.id=i.category AND i.live_date!='0000-00-00 00:00:00' AND i.removed=0 ORDER by live_date LIMIT 0, 6 returned 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 c.id=i.category AND i.live_date!='0000-00-00 00:00:00' AND i.' at line 10