$query = mysql_query("SELECT U.username, U.uid, U.full_name, M.uid_fk FROM tb_favorite M, tb_user U WHERE U.uid = M.uid_fk AND M.msg_id_fk = '$get_post_id' LIMIT 3");
while($row = mysql_fetch_array($query))
{
$like_uid = $row['uid_fk'];
$likeusername = $row['username'];
$likefull_name = $row['full_name'];
if($like_uid == $uid)
{
echo '<span id="youlikes'.$get_post_id.'">You</span>';
}
else
{
echo '<span id="youlike'.$get_post_id.'"></span> <a href="'.$likeusername.'">'.$likefull_name.' </a>';
}
}
favorited this
Assuming I login using user1 (User1 is You). When the query running, it will show like this :
You, user2, User3 favorited this.
But if I login using user2, when query running, it will show like this :
User1, You, User3 favorited this.
I think it's because the first saved to table will show first.
What I want is, when I log on using User1/User2/User3, "You" must be first of another user when favorited this.