2013-10-01 69 views
0

出於某種原因,我的user_id被存儲在我的數據庫中爲2147483647,而不是實際的user_id。有誰知道爲什麼會發生這種情況?Facebook - 爲什麼從signed_request中將我的user_id存儲爲最大整數?

if ($_REQUEST) { 
    $response = parse_signed_request($_REQUEST['signed_request'], 
           FACEBOOK_SECRET); 

    $name = $response["registration"]["name"]; 
    $email = $response["registration"]["email"]; 
    $facebookID = $response["user_id"]; 

    $connect = mysqli_connect($db_host,$db_user,$db_pass); 
    mysqli_select_db($connect,$db_name); 
    // Check connection 
    if (mysqli_connect_errno()) 
    { 
     echo "Failed to connect to MySQL: " . mysqli_connect_error(); 
    } 

    $result = mysqli_query($connect, "INSERT INTO User (U_id, U_name, U_email) VALUES ('$facebookID', '$name', '$email')") or die (mysqli_error($connect)); 

回答

1

的Facebook用戶ID需要更多的存儲空間, 我覺得你給它一個整數嘗試它有大範圍的其他一些數據類型。
結論是檢查是你的數據類型是整數,那麼如果yes變化數據類型varchar否則和try again

相關問題