title: Facebook API - Fatal error: Uncaught Exception: 601: Parser error: unexpected ')' at position 37
body: <p>I have a FB app script and im trying to make it work but I get this error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Exception: 601: Parser error: unexpected ')' at position 37. thrown 
    in /home/altin/public_html/apps/empower/empowermix/base_facebook.php on line 658</p>
  </blockquote>
  
  <p>Here is the part of the script where I get the error:</p>
  
  <pre><code>$friendsLists = $facebook-&gt;api('/me/friends');
    foreach ($friendsLists as $friends) 
    {
     $ile=count($friends);
    }
  
  $zapytanie=" (uid=".$friends[0]['id'].") ";
    for($i=1;$i&lt;$ile;$i++)
    {
      $zapytanie.=" or (uid=".$friends[$i]['id'].") ";
    }
  
  **$znajomi = $facebook-&gt;api(array("method"=&gt; "fql.query", "query"=&gt; "SELECT uid FROM page_fan WHERE ".$zapytanie." AND page_id='".$page_id."'")); //friends w fanpage**
  
  $sql=mysql_query("SELECT * FROM '".$przedrostek_tab."ludzie' WHERE 'uid'=".$user_info['id']);
  $czy_jest=mysql_fetch_array($sql);
  foreach($znajomi as $k =&gt; $w)
        {$znajomi_weryfikacja[$k]=$w['uid'];}
  if($znajomi_weryfikacja)
    {$znajomi_weryfikacja=( array_diff($znajomi_weryfikacja, explode("|",$czy_jest['znajomi_start'])));
    if($czy_jest[0])
      {foreach($znajomi_weryfikacja as $k =&gt; $w)
        {$zaproszeni_znajomi.=$w.'|';}
      mysql_query("UPDATE '".$przedrostek_tab."ludzie' SET 'zaproszeni_znajomi' = '$zaproszeni_znajomi' WHERE 'uid' =".$user_info['id']);}
    }
  </code></pre>
  
  <p>Can anyone help suggest a solution? Maybe some of you may have faced similar problems before.</p>
  
  <p>Thanks.</p>