Ádám Sztefanov Ádám Sztefanov - 1 month ago 25
PHP Question

17 characthers Facebook user id gets stored with a different value in MYSQL using Facebook php SDK v2.10

$user = $response->getGraphUser();
$fid = $user['id'];

echo($fid); //10155784607879101

//in mysql table i get 2147483647 in the fid column for the following query

$stmt = $dbh->prepare("INSERT INTO users(fid) VALUES (:fid)");
$stmt->bindParam(':fid', $fid);

//in this case $fid not equals $stmt->bindParam(':fid', $fid);

I read this in the Facebook developers documentation:

numeric string
The id of this person's user account. This ID is unique to each app and cannot be used across different apps. Our upgrade guide provides more information about app-specific IDs

I cannot identify my users when they return on my site and login using Facebook.
Anyone has suggestion?

Thanks in advance,


Answer Source

To store the Facebook ID you need the field to be an unsigned BIGINT.