The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Combining a few queries into one

I'm trying to combine a few queries together to (obviously) require my script to make fewer queries.

This will need to combine stuff from three tables. I can handle two, but this is a bit beyond me.

This site will allow users to subscribe to various sports games. When they pull up a page, I want it to show some games (based on other criteria). For each game, it needs to translate the team IDs into their names, but also needs to see if there is an entry for that game subscription already in the database. The result would look something like:

I know I spit out $row["teamone"] or whatever for each variable. But what does the subscription stuff come out as? I imagine I'd do an if-->then to determine what text to print, but what variable would I be doing the if-->then on?