This works fine, but there is a problem when it returns less than 8 results.
Is there any alternative than to repeat a query for the rest of the results that are missing?
Any help would be appreciated, thanks.
$vacation = mysql_query("SELECT i.*
FROM vacation_offer_tbl i
INNER JOIN vacation_offer_pics_tbl c ON (c.vacat_offer_id = i.vacat_offer_id)
WHERE i.conditional ='1'
AND c.pic_1 != ''
// if < 8 results rerurn the rest where c.pic_1 ='nothing'
ORDER BY rand()
LIMIT 8") or die(mysql_error());
Im not sure how well this will work with the
ORDER BY rand()but something like this might help