All my members are stored in a table called members. I have another table called friends which basically links which members are friends with other members. When a member logs in, I want it to show all messsages posted by friends only. Is this the easiest way....
SELECT friend FROM friends WHERE member = $_SESSION['member']
This will give a list of friends which goes into an array called $row. I then loop the array and create another query inside...
SELECT title, description FROM messages WHERE poster = $row['friend']
Does this sound about right? Also, If I am using $row as the array for the first query, can I use another $row again for the second query or does it have to be called $row2?