I have a code that outputs member count of a facebook group. However, it does not show the correct number. 1.It will always show a less count 2.Sometimes it shows 0 I have installed the sdk and also I am a subscriber of the group where I am running this code so ideally it should permit me and give the correct result. Can someone shed some light on it?
<?php
require_once('src/facebook.php');
$config = array(
'appId' => 'MY APP ID',
'secret' => 'MY SECRET',
'cookie' => true
);
$facebook = new Facebook($config);
$query = urlencode("SELECT uid FROM group_member WHERE gid = 000000000000000");
try {
$fbData = $facebook->api("/fql?q={$query}");
$member_count = count($fbData['data']);
} catch (FacebookApiException $e) {};
?>
<div><?php echo $member_count; ?></div>
Thanks
Correct appID and secret, check gid in mysql "$query"...
Do you have good src to facebook.php and you import lib ?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.