Programatically tie together tables with IDs

Maybe there’s a better way to do this, but I mean, I always wondered what a solid way of doing this was. You have like a table articles with authorID or what have you, and you have your users table with userID, obviously they’re related.

How do you decide how to check, for example if your profile page is profile.php?u=thisGuysUsername – For all articles by that person. You run through a function that grabs an array of their data, get their ID from their username, then check the other tables for authorID of the userID you got? Seems like a lot of running around for it, no?

Thanks guys.

If what you want to do is check for authorID’s that are not in the users table you can do that with a single query using “not in” and a sub query. Or what exactly are you trying to check?