I am working on a chat display for a website. The idea is all of your friends posts will show up on your page but your friends friends posts will not. Table 1: username = moki, friend = jeff username = moki, friend = Brian username = Brian, friend = Greg Table 2: username = moki, comments = test post 1 username = greg, comments = test post 2 Outcome should be: Jeff, Brian, and moki should get the test post 1 not greg .... and only greg and brian would get test post 2 not moki or jeff this is how it displays now (which of course is only your own posts): $resultcmt = mysql_query("SELECT * FROM comments WHERE comentee = '$playername' ORDER BY commentid DESC") or die(mysql_error()); while($rowcmt = mysql_fetch_array($resultcmt)) { echo "" . $rowcmt['comentor'] . " " . $rowcmt['coments'] . ""; How can I have this also search for your friends posts and display them?