13.06.2015, 09:51
With the information you've given so far is kind of difficult to help you but what you're looking for is:
https://dev.mysql.com/doc/refman/5.0/en/join.html
and in the worst case scenario that JOINs cannot be used: https://dev.mysql.com/doc/refman/5.0/en/subqueries.html
https://dev.mysql.com/doc/refman/5.0/en/join.html
and in the worst case scenario that JOINs cannot be used: https://dev.mysql.com/doc/refman/5.0/en/subqueries.html

