Python/MySQL cannot persist integer data correctly
P粉025632437
P粉025632437 2024-04-04 19:09:44
0
1
368

No need for any code here. I want to save a very long number because I'm making a game and need to save scores. But I tested it and set the score to 25000000000 but saved it in mysql as 2147483647. I also modified the limit for integers and set it to an integer in mysql. Any ideas? If the number is under 10 digits it works, but if it is more than 10 digits, it doesn't work even if I modify the limit.

P粉025632437
P粉025632437

reply all(1)
P粉293341969

Use BIGINT data type instead.

According to the MySQL documentation, the INT type only supports signed values ​​between -2147483648 and 2147483647, while the BIGINT type supports signed values ​​between -2^63 and 2^63 - 1 (-9223372036854775808 to 9223372036854775807).

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!