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

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

问题描述

我的问题比技术性更为咨询。
我正在写一个Facebook应用程序,其中我提取了一些有关用户的信息,包括facebook_id。

我想知道我是否应该将用户ID保留在MySQL数据库中的INT或VARCHAR

解决方案

Facebook为其用户ID使用 64位整数(bigint)。所以你在MySQL中使用Bigint UNSIGNED。



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



编辑:Facebook用户名与用户ID不同。用户名当然是varchar,但不会作为id返回。


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 uses 64-bit integers (bigint) for their user ids. So you use Bigint UNSIGNED in MySQL.

"As a reminder, in the very near future, we will be rolling out 64 bit user IDs. We encourage you to test your applications by going to www.facebook.com/r.php?force_64bit and create test accounts with 64 bit UIDs."

Edit: 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天全站免登陆