Allow number to start with ZERO when stored in mysql integer field

前端 未结 7 2196
甜味超标
甜味超标 2021-01-02 01:42

I need to store phone numbers starting with 0 but whenever i try to store this in MySql table the starting ZERO is removed because no number start with Zero actually.

<
7条回答
  •  不知归路
    2021-01-02 02:22

    Phone numbers are not really numbers in the sense that they aren't ordinal. They're just characters - they fact that they are numbers is incidental.

    Store them in a varchar and move on :D

提交回复
热议问题