开发者

Not have a minimum MySQL INT Value

开发者 https://www.devze.com 2023-03-11 09:56 出处:网络
When I add a number beginning with 0 into my MySQL database, it automatically gets converted to a single digit. These are mobile numbers, so I need to keep it starting wi开发者_JAVA技巧th 0.Store phon

When I add a number beginning with 0 into my MySQL database, it automatically gets converted to a single digit. These are mobile numbers, so I need to keep it starting wi开发者_JAVA技巧th 0.


Store phone numbers as strings, not integers. (related: Common MySQL fields and their appropriate data types )


Try storing the numbers as varchars instead. When you retreive them from the database you could cast them using (int) if needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号