What mysqli value for bind_param() i or s

前端 未结 2 1646
灰色年华
灰色年华 2021-01-21 11:17

I am using mysqli bind_param() when I\'m inserting stuff to my DB.

When I tried to insert a phone number as \"0737327373\" the value got inserted as \"73732

2条回答
  •  旧巷少年郎
    2021-01-21 11:19

    If you are inserting a "number" into a varchar field then yes, use an "s".

    In your case it makes no real sense to insert a phone number as an integer since you probably won't be doing any math analysis on it and you lose functionality (leading zeros, for example).

提交回复
热议问题