Jump to content

Troublesome query


Darno7

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.