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 Link to comment https://forums.phpfreaks.com/topic/75989-solved-member-list-excluding-a-record/ 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. Link to comment https://forums.phpfreaks.com/topic/75989-solved-member-list-excluding-a-record/#findComment-384653 Share on other sites More sharing options...
jonoc33 Posted November 4, 2007 Author Share Posted November 4, 2007 Thanks, worked Link to comment https://forums.phpfreaks.com/topic/75989-solved-member-list-excluding-a-record/#findComment-384654 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.