MySQL and PHP - insert NULL rather than empty string

后端 未结 9 1254
陌清茗
陌清茗 2020-11-28 03:34

I have a MySQL statement that inserts some variables into the database. I recently added 2 fields which are optional ($intLat, $intLng). Right now, if these values are not

9条回答
  •  猫巷女王i
    2020-11-28 03:55

    All you have to do is: $variable =NULL; // and pass it in the insert query. This will store the value as NULL in mysql db

提交回复
热议问题