Saving facebook id as int or varchar?(将 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 facebook id 保存为 int 或 varchar?


基础教程推荐
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01