问题描述
大多数情况下,我使用cms进行操作,但之前并没有直接使用sql.我正在创建一个我要保存页面ID的Facebook页面目录,有时Facebook页面ID的长度为10-13位.那么我应该使用哪种类型的int.我正在考虑BIGINT
,但是它的长度应该是多少?
Most often i work with cms but did not worked with sql directly too much before. I am making a facebook page directory where i am saving page ids the length of facebook page id is 10-13 digit sometimes. So what types of int i should use. I am thinking about BIGINT
but what should be the length of it ?
这是直观的表格.如果您能建议字段的长度,我会很高兴.
Here is the table visually. I would be glad if you can advice the length of the fields.
这里是我想出的数据类型和长度.但是,如果这些方法有效,我会感到困惑:
- ID:页面的数据库ID(int 5)
- page_id :Facebook页面ID(bigint)
- 页面名称: Facebook页面名称(varchar 50)
- 用户名:页面的用户名(varchar 50)
- 点赞次数:点赞次数(int)
- 链接:链接到页面(varchar 100)
- 已添加时间:当前时间戳
- ID: Database id for the pages (int 5)
- page_id: Facebook page id (bigint)
- page_name: Facebook page name (varchar 50)
- username: username of the page (varchar 50)
- likes: number of likes (int)
- Link: Link to the page (varchar 100)
- Time_added: current timestamp
推荐答案
正确,您将需要一个BIGINT
: http://dev.mysql.com/doc/refman/5.6/en/numeric-types.html .
Correct, you'll need a BIGINT
: http://dev.mysql.com/doc/refman/5.6/en/numeric-types.html.
我建议您为VARCHAR
字段使用更长的长度.它不会造成任何伤害,特别是URL可能会变得很长.我可能会将两个50个字符的字段增加到100个,并在链接"字段中允许输入1000个字符.
I'd recommend longer lengths for your VARCHAR
fields. It won't hurt anything, and URLs in particular can get very long. I'd probably bump up the two 50-character fields to 100, and allow for 1,000 characters in the Link field.
这篇关于存储我的Facebook个人资料ID的sql表中的int值应该是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!