SELECT a.*, UNIX_TIMESTAMP(a.createdon) AS timestamp, ct.cityname,
COUNT(*) AS piccount, p.picfile,COUNT(v.name) as name,
scat.subcatname, cat.catid, cat.catname
FROM clf_multicities c
INNER JOIN clf_ads a ON a.adid = c.adid
INNER JOIN clf_cities ct ON a.cityid = ct.cityid
INNER JOIN clf_subcats scat ON a.subcatid = scat.subcatid
INNER JOIN clf_cats cat ON scat.catid = cat.catid
LEFT OUTER JOIN clf_adxfields axf ON a.adid = axf.adid
LEFT OUTER JOIN clf_adpics p ON a.adid = p.adid AND p.isevent = '0'
LEFT OUTER JOIN clf_advds v ON a.adid = v.adid AND v.isevent = '0'
LEFT OUTER JOIN clf_featured feat ON a.adid = feat.adid AND feat.adtype = 'A'
WHERE 1
AND a.enabled = '1' AND a.verified = '1' AND a.expireson >= NOW() AND a.paid <> '0'
AND (feat.adid IS NULL OR feat.featuredtill < NOW())
AND c.cityid=345
GROUP BY a.adid
ORDER BY a.createdon DESC
LIMIT -995801883200, 100You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-995801883200, 100' at line 22