hello,
I'm making a flash/php message board.
At the moment, I'm hitting the database twice to get some information. But can I condense these two queries into one?
First I use this query to get the parent_id of the current message from the msg_family table...
$query = "SELECT parent_id FROM msgfamily WHERE msg_number = '$p'";
Then I run another query to retrieve all the information relating to messages with the same parent_id as the current message from the tables users, msg_family and messages.
SELECT * FROM msgfamily AS mf, messages AS m, users AS u WHERE mf.parent_id = '$p' AND m.msg_id = mf.msg_number AND m.user = u.user_id ORDER BY mf.family_id ASC"
But is it possible to make this into just one query?
Thanks for your help.