1 Replies - 970 Views - Last Post: 25 November 2012 - 12:43 AM

#1 dreamincodehamza  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: -12
  • View blog
  • Posts: 332
  • Joined: 12-September 08

mysql data type field size/length

Posted 24 November 2012 - 06:23 PM

Hi,
I need help understand mysql data type field size/length.
here is my SQL.
not getting the role of datatype(M) M- length/size

int(5) -- it must be store and display size of 5.
but it is storing more then 5 integers.

This post has been edited by dreamincodehamza: 24 November 2012 - 06:25 PM

Is This A Good Question/Topic? 0
  • +

Replies To: mysql data type field size/length

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: mysql data type field size/length

Posted 25 November 2012 - 12:43 AM

That’s according to the Manual. the display size only takes effect if the number is smaller than the size:

MySQL Manual - Numeric Type Attributes said:

For example, for a column declared as INT(4) ZEROFILL, a value of 5 is retrieved as 0005.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1