| Code: |
|
<? $status_friend = mysql_query("SELECT * FROM `friends` WHERE `there_id`='$logged[id]'"); while($status_friends = mysql_fetch_array($status_friend)) { $select_status = mysql_query("SELECT * FROM `moods` WHERE `uid`='$status_friends[my_id]' ORDER BY `id` DESC LIMIT 10"); while($status_select = mysql_fetch_array($select_status)) { echo("$status_select[uid] - $status_select[status]<br>"); } } ?> |
This is my bit of code what i am trying to do is to display the last 10 moods posted by the LOGGED users ID such as:
1 - Hola
2 - im next
1 - i am back again
But what my code is doing is arranging it by the friends ID instead of the status ID,
It is displaying
1 - Hola
1 - i am back again
2 - im next
If anyone can help with this would be really helpful.
Thanks
