Home > Database > Mysql Tutorial > 关于mysql插入int空值的处理_MySQL

关于mysql插入int空值的处理_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:35:35
Original
1427 people have browsed it

bitsCN.com

最好的也是用的最多的方法是:

将int型空值不允许为空 默认为0.这样就不会出现因为允许为空 插入空值变为0的情况。虽然用起来要判断一下,但却不会出现问题。

其它的方法,来自网络,咱未验证

如果已经安装好了的,就在my.ini中查找sql-mode,默认为sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",将其修改为sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",重启mysql后即可。

bitsCN.com
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template