How can I break while loop and for loop too when while loop is true?
<?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"!
}
}
?>
break 2;work? See: php.net/manual/en/control-structures.break.php$i = 0;?