php - stop mysql_fetch_array when reach username -
i have code list of users database , sort them score.
$sql="select * users order score desc"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){
what want do, stop loop proces, when proces reach decided username.
use break
if
condition
while($rows=mysql_fetch_array($result)){ if($rows['name'] == 'yourname') { break; }else { //your code } }
Comments
Post a Comment