hi guys, i have a wall script. it is working fine but i'm facing one issue that is, 'single post is shown multiple times on user's own wall and one time on his friend wall. for example if A have 5 friends script will show single post 5 times. As it is showing one time on friend wall, this portion is working good but issue is on users own wall.
here is code:
$qfu = "SELECT * FROM my_friends WHERE (user_id = '$user_id' OR friend_id = '$user_id') AND status = '1'";
$fu = mysql_query($qfu) or die(mysql_error());
$rowfu = mysql_num_rows($fu);
while($rowf = mysql_fetch_array($fu)){
$user_id = $rowf['user_id'];
$friend_id = $rowf['friend_id'];
$querymsgs = "SELECT * FROM messages where uid_fk = '$friend_id' OR uid_fk = '$user_id' order by msg_id DESC Limit 1";
$qmsgs = mysql_query($querymsgs) or die(mysql_error());
$row_msgs = mysql_num_rows($qmsgs);
while($msgs = mysql_fetch_array($qmsgs)){
$msg_id = $msgs['msg_id'];
$orimessage = $msgs['message'];
$message = tolink(htmlentities($msgs['message']));
$time = $msgs['created'];
$privacy = $msgs['privacy'];
if($privacy=='0'){ $privacy='Only Me';} elseif($privacy=='2'){ $privacy='Public';} else { $privacy='Friends';}
$uid=$msgs['uid_fk'];
$fullname=$msgs['fname']." ".$msgs['lname'];
$face=$Wall->Avatar($uid);
$commentsarray=$Wall->Comments($msg_id);
?>
please help me to get rid off this issue. I'm trying since 2 weeks to solve it but failed to get any good result.