将facebook id保存为int或varchar? [英] Saving facebook id as int or varchar?
本文介绍了将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.
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屋!
查看全文