ilhan ilhan - 1 year ago 121
MySQL Question

How to allow empty string for integer in MySQL?

I have integer fields in a table. The POSTs are send by a complicated JavaScript. They send empty string like "" but as you guess MySQL doesn't allow emty strings in integer fields. Is there any option to allow empty strings? Like if it takes empty string it will save it as NULL.

Answer Source

Removing sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" from my.ini has solved the issue.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download