Say this table :
User
id | username | highest_score
1 | detectivepikachu | 1000
2 | fullmetaljacket | 4000
3 | sonicthegreat | 8000
4 | inspectorgadget | 2000
5 | themartian | 8000
I need to loop through all users highest scores and pick the ones with a score higher to 5000. I'm using a while loop.
while($user = $user_result-> fetch_assoc()){
if($user['highest_score'] >= 5000){
echo $user['username'];
echo '<br>';
}
}
This while statement will work and will display
sonicthegreat
themartian
But what I want is only displaying one of them randomly. How can I limit only one row to be displayed?