|
Figured this out!
I just created a function that counts the number of friends a user has:
function count_friends(){
global $db, $user;
$friends = "SELECT count(*) FROM " . table_friends . " INNER JOIN " . table_users . " ON " . table_friends . ".friend_from = " . table_users . ".user_id WHERE (((" . table_friends . ".friend_to)= " . $user->id . ")) ;";
$count=$db->get_var($friends);
echo $count;
}
|