Question

This is My Code

$ids = join(", ",$man);

    if ( !isset($_SESSION[$appID.'_FQLResult']) ) {



        $FQLQuery = "SELECT uid, sex, pic_square FROM user WHERE uid in ($ids)";



        $FQLResult = $facebook->api(array( 'method' => 'fql.query', 'query' => $FQLQuery, 'access_token'=>$fbme['access_token'] ));
        $_SESSION[$appID.'_FQLResult'] = $FQLResult;
    } else {
        $FQLResult = $_SESSION[$appID.'_FQLResult'];
    }
echo $ids;
echo $FQLResult;

There is an error when i echo $ids it shows the value of $ids but when i echo $FQLResult is shows only "array" written whats wrong in this fql query? how i can fix this? I think there is something wrong in this query $FQLQuery = "SELECT uid, sex, pic_square FROM user WHERE uid in ($ids)";

Was it helpful?

Solution

  1. Use implode() directly instead of join()
  2. After a successful API call, you should be expecting an array, so use print_r($FQLResult);
  3. Always, if you are not sure of the type of the variable use var_dump()
  4. You may want to use the new Graph API end-point (/fql?q=YOUR_QUERY), read here
  5. Serialize your array before adding to sessions
  6. Watch our of the session size limits!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top