I have 2 table in my db on contains users and has the following fields
id int
fname varchar
lname varchar
friends text friends are stored like 8,9,10
the second table contains postings
id int
mem int
date datetime
post varchar
what i need to do is select from the postings the all rows that contain the mem and all rows that the member is a friend of
i have tried the following and can get the mem and the last friend in friends but no others
$getfriends = mysql_query("SELECT id, friends FROM users WHERE id='$id' LIMIT 1");
while($row=mysql_fetch_array($getfriends)) {
$friend = $row["friends"]; }
$friend = explode(",", $friend);
foreach ($friends as $friend) {
$sqlpostings = mysql_query ("SELECT * FROM postings WHERE mem = $id OR mem_ = '$friend' ORDER BY date DESC ");
while($row = mysql_fetch_array($sqlpostings)){