Here’s what I want to do:
-
select tableB.column1 WHERE tableB.column2 = some_var -
select tableA.column1 WHERE tableA.column2 was a result from step one.
Can this be done in one select? What’s the best way to do this, especially performance-wise? I’m using PHP.
EDIT:
I have a conversation based messaging system. 1 convo table and 1 replies table. Replies table includes columns: responder and convo_id. To load convo I get all replies with that convo_id.
I want to use the convoId to get all responders to that convo, and go into usertable and select all the avatars of responders, then store the avatars in array and echo them out as needed.
You may want to try the following sql statement
this will get all the avatars of the users who participated in the conversation with id 1234