Code:
$query = "SELECT post_id, actor_id, comments, likes FROM stream WHERE source_id = ".$user." LIMIT 500";
$result = mysql_query($query);
$count = count($result);
$total=$count;
for ($i = 0; $i < $count; $i++)
{
$actor_id = $result[$i][actor_id];
$count_c = $result[$i][comments][count];
if($count_c > 0){
for ($a = 0; $a < $count_c; $a++){
$comment_id = $result[$i][comments][comment_list][$a][fromid];
}
}
$count_l = $result[$i][likes][count];
if($count_l > 0){
for ($b = 0; $b < $count_l; $b++){
$likes_id = $result[$i][likes][friends][$b];
}
}
Code:
That query would return: ( Each of these integers represent a unique user id )
65653171
67418530
108832181
58579401
55125266
60906602
Now when i run this query on my DB i'll get around 500 different users id's, but lots will be duplicates.
Some will appear 10 times, some 34 times, some 5 times.
All i want is to calculate the number of times they each come up??
Know what i'm saying??
Bookmarks