Q:

Selecting users with criteria from second table

I want to select users only who submitted a profile picture.  I have two tables, users and users_info.  
The users table holds basic information about the user

The users_info table holds information which is used in addition to the basic information

I would be able to do this using PHP to grab a bunch of users and only go with those with images, but I'd prefer doing it using a single query.  How can i accomplish this? 

A:

This should do it:
SELECT u.id
FROM users as u
INNER JOIN users_info as ui
ON u.id = ui.user_id
WHERE profile_image is not null

If you aren't familiar with joins, I would recommend giving this post a read.   It is the best I've found for introducing people to the concept.