mysql int类型字段插入空字符串时自动转为0

mysql int类型字段插入空字符串时自动转为0

如果不想转的话可以修改配置文件

修改 my.ini 文件.

# Set the SQL mode to strict
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

改为:

# Set the SQL mode to strict
sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

原文地址:https://www.cnblogs.com/sanhao/p/8670393.html