So basically, i’m trying to make some sort of timeline with the post of my users, that gives me the posts of all users ordered by time. But instead, gives me the following:
*User1 'post1',
User1 'post2',
User1 'post3'..
*User2 'post1',
User2 'post2',
User2 'post3'..
I want all the post ordered instead of all the posts from user1 then all the posts from user2, etc. Well i hope it made sense thank you guys.
The query
<?php
$varq1 = mysql_query('SELECT id2 FROM followers WHERE id ="'.$_SESSION['id'].'"');
while($req5 = mysql_fetch_array($varq1)){
$req9=$req5['id2'];
$nsql = mysql_query('SELECT content, id, profile_id FROM contenido WHERE profile_id in("'.$req9.'") order by content_time desc');**strong text**
while($nrow = mysql_fetch_array($nsql)){
?>
The HTML/ php call
<div class="divider">
<center><?php echo "".$nrow['content'].""; ?><center/>
</div>
you can do both queries in a single one … giving you the ability to sort by time
fetch that and you will have exactly what you want 🙂 all the posts from different users sorted by time.