好吧,我要做一个 Facebook MySQL 和 PHP 项目,但我收到一个错误,我不知道这是什么,有一个页面和一个输入(文本)用户输入和 facebook 的 id 帖子,用户点击提交通过 jQuery 将数据发送到 like_object.php 的按钮,其代码为:
<?php
require 'facebooksdk/facebook.php';
$id = trim($_POST ['postid']);
if(empty($id)){
die("forbidden");
} else {
$token = $_GET["accesstoken"];
include('config.php');
//Create facebook application instance.
$facebook = new Facebook(array(
'appId' => $fb_app_id,
'secret' => $fb_secret
));
$output = '';
//get users and try liking
$result = mysql_query("
SELECT
*
FROM
W3
");
if($result){
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$m = $row['access_token'];
$facebook->setAccessToken ($m);
try {
$facebook->api("/$id/likes", 'POST');
$msg1 = "<div class='alert alert-info'><strong>Success</strong></div>";
} catch (FacebookApiException $e) {
$output .= "<p>'". $row['name'] . "' failed to like.</p>";
$msg2 = "<font color='red'>Failed to Like!</font>";
}
}
}
mysql_close($result,$connection);
}
?>
我检查了错误日志(facebook SDK 生成它)
[16-Jul-2013 15:25:29] PHP Warning: Wrong parameter count for mysql_close() in /home/like_object.php on line 43
[16-Jul-2013 15:27:24] PHP Parse error: syntax error, unexpected T_VARIABLE in /home/like_object.php on line 33
那么我的php哪里出了问题?