在while循环内部循环

Ahm*_*med 1 php

当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)