I'm trying to write code that basically finds your facebook friends that are on my website. I succeed in phpmyadmin running the query but for some reason when i try to run the code from php it doesn't work
Here's the php code. Whenever i take the $string echo and place it in mysql it works just fine, but for whatever reason when running it in php the query is not returning any results.
$fql = "SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 100000903067831) AND is_app_user = 'true'";
        $param  =   array(
            'method'    => 'fql.query',
            'query'     => $fql
        );
    $this->load->library('facebook');
    echo  $this->facebook->getLoginUrl();
    $fqlResult   =   $this->facebook->api($param);
    $userIDarray = array();
    foreach($fqlResult as $result)
    {
        echo $result['uid']."<br>";
        array_push($userIDarray, intval($result['uid']));
    }
    $string = implode(', ',$userIDarray);
    echo $string;
    $vars = array($string);
    $query = $this->db->query("SELECT * FROM users WHERE users.facebook_id IN (?)", $vars);
    echo var_dump($query);
    foreach($query->result() as $data)
    {
        echo var_dump($data);
    }
 
    