Jump to content

Recommended Posts

I'm stuck on this sql query that gets a list of users that can be made into moderators. I got a database with a table called category_moderators, which has two fields category_id and user_id. I'm making a drop down list of available users that can be made into moderators, but I only want to display users who are currently not a moderator for that particular category.

 

This is my query I'm using atm:

$get_moderators=mysql_query("SELECT users.user_id, users.user_name FROM users, category_moderators WHERE (category_moderators.category_id='$chosen_category_id' AND users.user_id!=category_moderators.user_id)")

 

Before this query is run the user picks the category they want to add the moderator to as such if they pick say category 1 then the query should exclude listing users that are moderators in category 1.

Link to comment
https://forums.phpfreaks.com/topic/75610-solved-stuck-on-sql-query/
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.