3
這工作正常,但返回的結果少於8個時出現問題。 有沒有其他方法可以重複查詢剩餘的結果? 任何幫助,將不勝感激,謝謝。當結果小於限制時mysql查詢
$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());
的偉大工程,非常感謝 – than107
@ than107沒有什麼問題,歡迎SO並請轉發支付它。 – invertedSpear
謝謝,會做! – than107