Jump to content

Query issue


czukoman20

Recommended Posts

   global $database;
   $q = "SELECT username,userlevel,email,num_clicks,timestamp,realname,phone "
       ."FROM ".TBL_USERS." ORDER BY userlevel DESC,username";

 

ok this is what i have right now.. it works but im unsure on this next part.

What i would like to do is make this query work so that it excludes any users that has a user level not equal to 5.

 

Where would i do this in the query

Link to comment
Share on other sites

daft question, firstly do you have an error message, or is it just not displaying the userlevel != 5

 

second daft question, do you have users that arent "5" in the database?

 

No it pops my error that i created for the query which is error cannot display info.

and yes i have 1 user with 5 in the database. 

 

 

Link to comment
Share on other sites

Hi,

 

That query should leave out any records with the userlevel of 5.

 

 $q = "SELECT username, userlevel, email, num_clicks ,timestamp ,realname, phone FROM tbl_users WHERE userlevel <> 5 ORDER BY userlevel DESC";

 

Try the query above and also formatting yer querys something like above, cleaner and easy to read.

 

hth

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.