just do one query to get whatever you need to put in the second query, for example if you wanted to do this
select * from table1 where id = '(select memberid from table2 where id = '4')'
you could do
query 1
select memberid from table2 where id = '4' // set that equal to a variable, then do second query
query 2
select * from table1 where id = '$variableyousetqueryonequalto'
something like that should help you out