Long integer is transformed when inserted in shorter column, not truncated. Why? What is the formula?

前端 未结 3 1796
醉梦人生
醉梦人生 2020-11-29 12:56

I have a column of type integer with length 10:

`some_number` int(10) unsigned NOT NULL

Into this column I insert a number tha

3条回答
  •  青春惊慌失措
    2020-11-29 13:26

    Well as far as i know, it doesn't have anything to do with PHP, bcx.

    • If PHP encounters a number beyond the bounds of the integer type, it will be interpreted as a float instead.
    • Also, an operation which results in a number beyond the bounds of the integer type will return a float instead.

    So it will be the functionality of SQL which changes the value.

提交回复
热议问题