将 facebook id 保存为 int 或 varchar? [英] Saving facebook id as int or varchar?

查看:25
本文介绍了将 facebook id 保存为 int 或 varchar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题更多的是咨询而不是技术.我正在编写一个 Facebook 应用程序,我正在其中获取有关用户的一些信息,包括 facebook_id.
我想知道我是否应该在 MySQL 数据库中将用户 ID 保留为 INT 或 VARCHAR?

My question is more advisory than technical. I'm writing a Facebook app in which I am fetching some information about the user, including facebook_id.
I was wondering if I should keep the user id as INT or VARCHAR in the MySQL database?

推荐答案

Facebook 使用 64 位整数 (bigint) 作为他们的用户 ID.所以你在 MySQL 中使用 Bigint UNSIGNED.

Facebook uses 64-bit integers (bigint) for their user ids. So you use Bigint UNSIGNED in MySQL.

"提醒一下,在不久的将来,我们将推出 64 位用户 ID. 我们鼓励您通过访问 www.facebook.com/r.php?force_64bit 来测试您的应用程序并创建具有 64 位 UID 的测试帐户."

Facebook 用户名与用户 ID 不同.用户名当然是 varchar 但不会作为 id 返回.

Facebook usernames is not the same thing as the user id. The username is of course varchar but will not be returned as the id.

这篇关于将 facebook id 保存为 int 或 varchar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆