ok, so, what im trying to do is complicated for me, im trying to do this with as least amount of server usage as possible... what im trying to do is basically make an output that shows my "friends updates" but in time order.
the code above is almost right, it shows the list and orders them ascending, but it does them by each friend. example
id date friend number
4 2012-05-22 19:15:07 <= friend #4
5 2012-05-22 21:28:58 <= friend #4
1 2012-05-22 16:51:22 <= friend #8
2 2012-05-22 16:56:24 <= friend #8
3 2012-05-22 16:56:49 <= friend #8
and its good but not quite all the way there, what im wanting to do is have it order the whole output by the date/time and not by friend order... right now as you can tell the output is listed by friend order from the exploded freinds list, and not by time. should i do a LEFT JOIN in there to save a query and would that help with ordering by the date/time? any directions would be great, thanks
gt
Code:
$sqlF = mysql_query("SELECT * FROM myMembers WHERE id=6 ");
while($rows = mysql_fetch_array($sqlF)){
$friend_array = $rows["friend_array"];
}
$friend_array = explode(",", $friend_array);
foreach($friend_array as $key => $value){
$sql = mysql_query("SELECT * FROM updates WHERE user=$value");
while($rowin = mysql_fetch_array($sql)){
$name .= ''.$rowin["datetime"].'<br />';
}
}
id date friend number
4 2012-05-22 19:15:07 <= friend #4
5 2012-05-22 21:28:58 <= friend #4
1 2012-05-22 16:51:22 <= friend #8
2 2012-05-22 16:56:24 <= friend #8
3 2012-05-22 16:56:49 <= friend #8
and its good but not quite all the way there, what im wanting to do is have it order the whole output by the date/time and not by friend order... right now as you can tell the output is listed by friend order from the exploded freinds list, and not by time. should i do a LEFT JOIN in there to save a query and would that help with ordering by the date/time? any directions would be great, thanks
gt
Comment