存储我的Facebook个人资料ID的sql表中的int值应该是多少? [英] What should be the leagth of int in a sql table where i store the facebook profile id?

查看:94
本文介绍了存储我的Facebook个人资料ID的sql表中的int值应该是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数情况下,我使用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.

这里是我想出的数据类型和长度.但是,如果这些方法有效,我会感到困惑:

  1. ID:页面的数据库ID(int 5)
  2. page_id :Facebook页面ID(bigint)
  3. 页面名称: Facebook页面名称(varchar 50)
  4. 用户名:页面的用户名(varchar 50)
  5. 点赞次数:点赞次数(int)
  6. 链接:链接到页面(varchar 100)
  7. 已添加时间:当前时间戳
  1. ID: Database id for the pages (int 5)
  2. page_id: Facebook page id (bigint)
  3. page_name: Facebook page name (varchar 50)
  4. username: username of the page (varchar 50)
  5. likes: number of likes (int)
  6. Link: Link to the page (varchar 100)
  7. Time_added: current timestamp

推荐答案

正确,您将需要一个BIGINT:

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值应该是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆