SELECT *, cat_l1.name AS c1_name, cat_l2.name AS c2_name, listing.name AS lt_name, listing.cat_l2_id AS lcat_l2_id FROM listing INNER JOIN cat_l1 ON cat_l1.cat_l1_id = listing.cat_l1_id INNER JOIN cat_l2 ON ((cat_l2.cat_l2_id = listing.cat_l2_id) OR (listing.cat_l2_id = 0))WHERE approve = 1AND listing.listing_id NOT IN (38780)
AND ((promo_until_sold = 1) OR (listing.cat_l1_id NOT IN (7)) OR (listing.timestamp_approve >= '2013-03-22 00:00:00')) GROUP BY listing.listing_id ORDER BY listing.hc DESC, listing.timestamp_approve DESC LIMIT 0,1000 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 'listing.listing_id NOT IN (38780)
AND ((promo_until_sold = 1) OR (listing.cat' at line 1 |