当while循环为真时,如何在while循环和for循环中断开?
<?php
for($i=0; $i<4; $i++){
$result = mysql_query("SELECT * FROM table WHERE weight='$i'");
while($row = mysql_fetch_array($result)){
echo $row['cell'];
break; //I need to break the while loop and the for loop too in this line exactly, when he find and echo the "cell"!
}
}
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2807 次 |
| 最近记录: |