By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,271 Members | 1,428 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,271 IT Pros & Developers. It's quick & easy.

select from three tables and WHERE statement

P: 16
I have a feeling that this is an easy question. However I'm a newbee and don't have any idea how to do this.
I have three tables that stores my users information. Each user has a unique ID that is same in all three tables and is the way that connects the data for the user.
Table1 has userid and useremail
Table2 has userid and status
Table3 has userid and name, email, phone number and .....

user status can be Active, Pending, Expired or Canceled.

I need to have a page that shows only Active users with their details on each row.

I know I need to use SELECT and WHERE, but I can do that only for table2. When I try to add other tables to it everything gets missed up.

Dec 20 '07 #1
Share this Question
Share on Google+
1 Reply

P: 157
You'll want to use JOIN between the tables. Something like this should work for you.

[PHP] Select
Inner Join TABLE2 On
Inner Join TABLE3 On
Dec 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.