定义字段时int(10) 或者int(8)这样有什么好处呢? 谢谢

解决方案 »

  1.   

    毫无意义。 除非你打算让你的最终用户直接用MYSQL命令工具来看数据。MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html
      

  2.   

    Another extension is supported by MySQL for optionally specifying the display width of integer data types in parentheses following the base keyword for the type (for example, INT(4)). This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)