Jump to content

Recommended Posts

I've been having problems with a query for a while, I think the solution is simple enough so I'm not sure if I even need to post it. The logic behind it is I have a part of my site that shows you the list of games a certain user can play. Teams decide to play each other, and then the players of each team sign up.

 

So the query to post the list of games the user is attached to, is working fine... but I'm having trouble finding the games the user isn't attached to but can play.

 

WHERE (proposedgame.userID="4") AND (proposedgameattached.teamID="3"); ---> This gives me the list of games where the user is on said team and is available for the game.

 

The problem is if I simply negate the userID <>"4" to find out what games the user isn't attached to but can play , I'll be giving a list of games that is tainted with other users data.

 

I hope this is detailed enough, I know it's probably simple but it's driving me mad.

Link to comment
https://forums.phpfreaks.com/topic/150456-troublesome-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.