United States / Events
SELECT a.*, COUNT(*) AS piccount, p.picfile, UNIX_TIMESTAMP(a.createdon) AS timestamp, ct.cityname, UNIX_TIMESTAMP(a.starton) AS starton, UNIX_TIMESTAMP(a.endon) AS endon FROM clf_events a INNER JOIN clf_cities ct ON a.cityid = ct.cityid LEFT OUTER JOIN clf_adpics p ON a.adid = p.adid AND p.isevent = '1' LEFT OUTER JOIN clf_featured feat ON a.adid = feat.adid AND feat.adtype = 'E' WHERE (starton <= '2021-09-07' AND endon >= '2021-09-07') AND a.enabled = '1' AND a.verified = '1' AND a.expireson >= NOW() AND (feat.adid IS NULL OR feat.featuredtill < NOW()) AND ct.countryid = 2 GROUP BY a.adid ORDER BY a.createdon DESC LIMIT 0, 50MySQL server has gone away