Facebook Connect uid MySQL 存储问题

发布于 2024-08-21 04:05:50 字数 443 浏览 8 评论 0原文

我正在进行 Facebook Connect 集成。我使用 Facebook PHP 库来获取 uid,例如:

$facebook = new Facebook($api_key, $secret); $fb_user = $facebook->require_login();

$fbuser 是一个 16 个字符的长 bigint,例如 1000002949493949

但是,当我将这个值插入 MySQL 时,它只插入 2949493949。

所以后来当我尝试将 uid 与存储在数据库中的 1000002949493949 相匹配时,它不会匹配,因为数据库返回 2949493949。

我的数据库中的 uid 字段是一个长度为 20 的 bigint。它最初是一个 int,但当我开始遇到新的、更长的 uid 时,我改变了它。

知道我需要做什么才能正确存储 uid 吗?

I'm doing a Facebook Connect integration. I use the Facebook PHP library to get the uid, like:

$facebook = new Facebook($api_key, $secret);
$fb_user = $facebook->require_login();

$fbuser is a 16-character long bigint, such as 1000002949493949

However, when I insert this value into MySQL, it only inserts 2949493949.

So later when I try to match the uid to the one stored in my database with 1000002949493949 it doesn't match because the database is returning 2949493949.

The uid field in my database is a bigint with a length of 20. It was originally an int, but I altered it when I started encountering the new, longer uids.

Any idea what I need to do to store the uid correctly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

羞稚 2024-08-28 04:05:50

当将 fb_uid 存储在数据库中时,您应该将其存储为 BIGINT (对于 mysql )

When storing the fb_uid in the db, you should be storing it as a BIGINT ( for mysql )

时光是把杀猪刀 2024-08-28 04:05:50

您还需要确保在 PHP 中使用 64 位整数。您能发布存储信息的 PHP 代码部分吗?

如果您使用 32 位版本的 PHP,我建议尝试将 id 保留为字符串而不是整数。

You need to make sure you're using a 64 bit integer in PHP as well. Can you post the PHP portion of the code that stores the information?

I would suggest trying to keep the id as a string and not an integer if you're using a 32 bit version of PHP.

向地狱狂奔 2024-08-28 04:05:50

最简单的方法是将 facebook 的 uid 值存储为 varchar。如果你只需要查询 mysql 数据库来获取 uid 值,那么这是最简单的方法。

the easiest way out would be to store the uid values from facebook as a varchar. if u only have to query the mysql db to get the uid value, then this is the easiest way out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文