鑑於這種代碼:是'繼續'我在找什麼?
while($thisrow = mysqli_fetch_array($thisresult)){
if($thisrow['displaythis'] == 'yes'){
echo $thisrow['name'];
} else {
continue;
}
$associatedquery = "select * from database where id = $thisrow['associated']";
$result = mysqli_query($associatedquery);
while($row = mysqli_fetch_array($result)){
echo $row['name'];
}
}
如果$ thisrow [「displaythis」] ==沒有,莫非要「繼續」處理associatedquery呢,還是要回去的下一個值首先聲明?如果不是,我如何跳回第一個while語句中的下一個值並跳過關聯的查詢?我知道我可以將整個'associatedquery'段放入if ='yes'語句中,但我不想那樣做。
繼續轉到循環的下一次迭代。 http://es1.php.net/continue – Orestes