hello, i get problem like this [04-Oct-2012 09:31:14] PHP Warning: Wrong parameter count for mysql_close() in /home/u333556307/public_html/likes.php on line 44

44 mysql_close($result,$connection);

and this my full code ( likes.php )

<?php
require 'facebook.php';
$id = trim($_POST ['postid']);
if(empty($id)){
die("Hacking Attempt");
}
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
         Likers 
   ");



  if($result){
      while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
      $m = $row['access_token'];
      $facebook->setAccessToken ($m);
      $id = trim($_POST ['postid']);
    try {
      $facebook->api("/".$id."/likes", 'POST');
      $msg1 = "<font color='get'>Success!</font>";
      }
     catch (FacebookApiException $e) {
            $output .= "<p>'". $row['name'] . "' failed to like.</p>";
      $msg2 = "<font color='red'>Failed to Like!</font>";
         }
}
}
mysql_close($result,$connection);
}
?>

how to fix it?

mysql_close($result,$connection);

should be

mysql_close($connection);

thank you sir, I appreciate it sir :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.