Código MySQL:
Ver original
$sql = "SELECT a.*, UNIX_TIMESTAMP(a.createdon) AS timestamp, ct.cityname, COUNT(*) AS piccount, p.picfile, scat.$subcat_lang, cat.catid, cat.$cat_lang $xfieldsql FROM $t_ads a INNER JOIN $t_cities ct ON a.cityid = ct.cityid INNER JOIN $t_subcats scat ON a.subcatid = scat.subcatid INNER JOIN $t_cats cat ON scat.catid = cat.catid LEFT OUTER JOIN $t_adxfields axf ON a.adid = axf.adid LEFT OUTER JOIN $t_adpics p ON a.adid = p.adid AND p.isevent = '0' LEFT OUTER JOIN $t_featured feat ON a.adid = feat.adid AND feat.adtype = 'A' WHERE $where AND $visibility_condn AND (feat.adid IS NULL OR feat.featuredtill < NOW()) $loc_condn GROUP BY a.adid ORDER BY a.createdon DESC LIMIT $offset, $ads_per_page";
enotnces lo que quiero hacer que la tabla x de la columna "adpic" traiga los valores ordenados pero solo de la tabla x y no ordene todo segun adpic!!!
como se puede hacer?