I need to get the result order by time but because im using a sql query into a while of an other sql query i get the result ordered by $arrID
$req1==mysql_query("SELECT friendId FROM friends ");
while($res1=mysql_fetch_row($req1)) {
$arrID = $res['friendId'];
$req = mysql_query("SELECT * FROM posts WHERE postby=$arrID ORDER BY posttime DESC ");
while ($res = mysql_fetch_row($req)) {
echo $res['bostby'];
echo $res['postcontent'];
}
}
the result is :
post 1 by 2 content aaaaaaaa time: 11:60
post 2 by 2 content bbbbbbbb time 11:59
post 3 by 2 content aaaaaaaa time: 11:58
post 4 by 2 content bbbbbbbb time 11:56
post 5 by 3 content aaaaaaaa time: 11:61
post 6 by 3 content bbbbbbbb time 11:60
post 7 by 3 content aaaaaaaa time: 11:59
post 8 by 5 content bbbbbbbb time 12:20
post 8 by 5 content bbbbbbbb time 12:19
and i need the resut to be order by time not by id
post 8 by 5 content bbbbbbbb time 12:20
post 8 by 5 content bbbbbbbb time 12:19
post 1 by 2 content aaaaaaaa time: 11:60
post 6 by 3 content bbbbbbbb time 11:60
post 2 by 2 content bbbbbbbb time 11:59
post 7 by 3 content aaaaaaaa time: 11:59