-7

I'm trying to add integer 12345678901234 in my DB.
Although my value is INT(15) but I face with error 'value out of range'.
Regards if anyone could help me.

Massoud
  • 361
  • 1
  • 2
  • 16
  • 1
    check here I answered here 2 days back http://stackoverflow.com/questions/23550231/long-integer-is-transformed-when-inserted-in-shorter-column-not-truncated-why/23550275#23550275 – Abhik Chakraborty May 12 '14 at 16:40
  • 2
    The number in parentheses is not the number of digits, but rather the display width of the column. – Tim Burch May 12 '14 at 16:43

1 Answers1

2

An int, with MySQL, is stored on 4 bytes, and, as such, can only contain values between -2147483648 and 2147483647.

To save 12345678901234 into your DB you need bigint type

underscore
  • 6,495
  • 6
  • 39
  • 78