Mko Posted March 27, 2012 Share Posted March 27, 2012 So I have this code: $skill_query = mysql_query("SELECT * FROM character_stats ORDER BY character_stats.". $fields[$skill] ." DESC LIMIT 0, $end", $c2) or print(mysql_error()); $user_query = mysql_query("SELECT user.username, user.userid, character_stats.uid FROM user, character_stats WHERE character_stats.uid = user.userid ORDER BY character_stats.". $fields[$skill] ." DESC LIMIT 0, $end") or print(mysql_error()); //WHERE user.usergroupid != 6 AND characters.banned = 0 $rank = 1; while($player = mysql_fetch_array($skill_query)){ if($user['userid'] != 1){ continue; } $user = mysql_fetch_array($user_query); if($rank >= $start) output($rank, $user['username'], $user['userid'], $player['combat'], $level, number_format($exp)); $rank++; } Yet for some reason it doesn't work. I know that the if($user['userid'] != 1){ continue; } Is the reason, but how do I fix it? Basically, my goal is to display these highscores, but omit UserID 1. Thanks. Quote Link to comment Share on other sites More sharing options...
cpd Posted March 27, 2012 Share Posted March 27, 2012 If you want to omit user ID 1 by using the "continue" statement you should test if it is equal to one, not if it is not equal to one. if(user[userID] == 1) continue; Quote Link to comment Share on other sites More sharing options...
Mko Posted March 27, 2012 Author Share Posted March 27, 2012 If you want to omit user ID 1 by using the "continue" statement you should test if it is equal to one, not if it is not equal to one. if(user[userID] == 1) continue; Is there any sort of method aside from the continue statement? Reason I ask is that whenever I use it, the output information becomes blank and doesn't display Quote Link to comment Share on other sites More sharing options...
samshel Posted March 27, 2012 Share Posted March 27, 2012 add user_id != 1 to the query ?? Quote Link to comment Share on other sites More sharing options...
Mko Posted March 27, 2012 Author Share Posted March 27, 2012 add user_id != 1 to the query ?? Just realized that'd work, thanks haha. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.