|
SELECT a.*, UNIX_TIMESTAMP(a.createdon) AS createdon,
COUNT(*) AS commentcount, ic.imgid AS hascomments
FROM clf_imgs a
INNER JOIN clf_cities ct ON a.cityid = ct.cityid
LEFT OUTER JOIN clf_imgcomments ic ON a.imgid = ic.imgid
WHERE a.enabled = '1' AND a.verified = '1' AND a.expireson >= NOW()
AND ct.countryid = 27
GROUP BY a.imgid
ORDER BY a.timestamp DESC
LIMIT 0, 5Can't create/write to file '/tmp/#sql_16e3_0.MYI' (Errcode: 122) |