I have the following query:
$mem_list = func_query("SELECT pr.productid, pr.product, mem.membershipid FROM $sql_tbl[products] AS pr
LEFT JOIN $sql_tbl[product_memberships] AS mem ON mem.productid = pr.productid
LEFT JOIN $sql_tbl[extra_field_values] AS ex ON ex.productid = pr.productid
WHERE pr.forsale='Y' AND ex.fieldid = '6' AND ex.value LIKE '%".$adv_star."%'
ORDER BY pr.product ASC");
This issue im having is that I also need to try to add to this query another check against $sql_tbl[extra_field_values] WHERE ex.fieldid = '1', but I dont know how to make this query in the same one and ORDER BY this last ex.value (not the first one). Any ideas?