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?


基础教程推荐
- 在多列上分布任意行 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01