jonoc33 Posted November 4, 2007 Share Posted November 4, 2007 Hi guys, I have a PHP code that displays a list of members out of a database. The code is the following: $results = mysql_query("SELECT username, userlevel FROM users"); while($values = mysql_fetch_array($results)){ echo $values['username']."- Rank: "; echo $values['userlevel'] != 9 ? "Member" : "Captain"; echo "<br />"; } It displays the Username and the Userlevel, and changes the userlevel to a word (eg 1>Member, 9>Captain). Now I made a user called "Admin", and it shows up in the memberlist. What I want to do is have a code that excludes the username "Admin" from it, so only Users that don't have that username show up. Any help? Jono Quote Link to comment Share on other sites More sharing options...
bwochinski Posted November 4, 2007 Share Posted November 4, 2007 Well, simply put, you could just: SELECT username, userlevel FROM users WHERE username<>'Admin' Although if you set the Admin user to a userlevel of "10" or something, you could filter by that, to allow more than one admin level account. Quote Link to comment Share on other sites More sharing options...
jonoc33 Posted November 4, 2007 Author Share Posted November 4, 2007 Thanks, worked 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.