I have sat for quite some time trying to work this out and just can’t manage it!
So here goes….
I have a player table
id | careerid | teamid
The teamid is linked to the id of the following team id
id | userid | careerid
Each user on my site has a session variable called id.
They are bidding on the player and when doing so, I need to use a query to check if the careerid of the player matches the careerid of the team table and then in the team table if the users session variable is present in the userid field.
Help please!!!
Assuming you’re passing the “users session variable” into the query as the @userId parameter, wouldn’t something like this work?
If that query returns a result, the player(s) returned are associated with the team specified by
@userId, and have the samecareerIdas the team.