title: How to handle the big int facebook uid returned by FQL?
body: <p>I've a problem in handling the big userid's of facebook and properly storing them into my database..</p>
  
  <p>As the fql.query REST api is going to be deprecated ,I'm using the GRAPH API for getting the results of the FQL. </p>
  
  <p>I want to get the list of my friends with sex,relationship_status .</p>
  
  <p>The query i executed is </p>
  
  <pre><code>$allFriends = $facebook-&gt;api("/fql
      ?q=SELECT+uid,+name,+sex,+relationship_status+FROM+user+where+uid+in+
      (SELECT+uid2+FROM+friend+WHERE+uid1+=$fbuid)"
  );
  </code></pre>
  
  <p>I tried the above in the Graph API explorer and the result is something like this,</p>
  
  <pre><code>  {
    "data": [
       {
        "uid": 100003082853071, 
        "name": "Sam jones", 
        "sex": "male", 
        "relationship_status": null
       }  
     ]
    }
  </code></pre>
  
  <p>Note the uid is returned as <strong>int</strong>, so whenever i print the array itself it has values like (1.34234422 +E03). So even json_encode for that array doesn't help.</p>
  
  <p>But when i call the GRAPH API directly something like '<code>graph.facebook.com/1585213/friends</code>' that returns the data as </p>
  
  <pre><code>{
    "data": [
      {
        "name": "Vijay Kannan", 
        "id": "102937142343"
      }
    ]  
  }
  </code></pre>
  
  <p>Note the id is returned as <strong>string</strong>..</p>
  
  <p>Whenever I'm using the graph API call for FQL query, it returns the whole data as an '<strong>Array</strong>' ,so the long big facebook uid's are transformed to a float like (1.34234422 +E03) . </p>
  
  <p>How can i convert them into proper uid's and store/process them back. </p>
  
  <p>I think the inconsistency of FQL and GRAPH API call should be also taken care by Facebook .. But i could not wait for that!!</p>
  
  <p>Any ideas on this?</p>