subselect to mysql

wxdqz

New Member
hello

i have 3 tables.
GAME containing columns - ID
PALYERS containing columns - gameID, userID
USER containing columns - ID

i need all users for each game where PALYERS.userID = $const

in other words:
i have a user logged into a webpage
then he or she needs to see
which games is he or she playing and to see for each game all his or her opponents.

the sql query with subselect

SELECT game.ID, user.ID
FROM game, players, user
WHERE
players.gameID IN (SELECT gameID FROM
players WHERE userID=$const)
AND
user.ID = players.userID;

$const is a PHP variable;

subselects are not supported in mySql
how can i make this query work in mySql?

does anybody know?
 
Back
Top