you can use a join query to bind the usermedia and media tables together
SELCT media.*
FROM media
INNER JOIN usermedia.MediaID = media.Media.ID
when a user logs in, the users ID is stored in a session variable.
edit your join query to add a where clause that will return the media only for the logged in user. Lets say for example that the name of the User session is "UserID":
WHERE usermedia.UserID = paramUID
then in the variables section, create a new variable:
Name: paramUID
Type: Number
Default value: -1
Runtime value: $_SESSION['UserID']
for more details on joined queries, see the following:
sql_join.asp