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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -