I don't think this is the answer you are looking for, but this might help anyway (it's easier to answer if you give some examples). I just figured out how to do this a couple days ago.
If you have a table called "table1" that has two fields, "first_name" and "last_name", and another table called "table2" that has two fields, "last_name" and "cats_name" where "last_name" is the same in both tables, and you want to return the "first_name" of anyone who has a cat named "Felix", you can do the following:
$query_cat = "SELECT `first_name` FROM `table1`,`table1` WHERE table1.last_name = table2.last_name AND table2.cats_name = "Felix";
Which I think works, but now I'm second guessing myself... you might need to change SELECT first_name to SELECT table1.first_name and I'm not even sure if the first part of the where statement is necessary... so now I'm not sure how great this response was...
But anyway, and if you get the idea and think it could be something helpful, this is called joining and you can look that up more at http://dev.mysql.com/doc/refman/5.0/en/join.html