Long integer is transformed when inserted in shorter column, not truncated. Why? What is the formula?
I have a column of type integer with length 10: `some_number` int(10) unsigned NOT NULL Into this column I insert a number that is too long: $some_number = 715988985123857; $query = "INSERT INTO this_table SET some_number = ?"; $stmt = $mysqli->prepare($query); $stmt->bind_param('i', $some_number); $stmt->execute(); When I look at what is in the table, the number is now: 2147483647 How and why did 715988985123857 turn into 2147483647 ? Why didn't it get truncated? What is the mechanism behind this transformation, and can the resulting number be calculated with some formula? I'm not looking for