Home >Database >Mysql Tutorial >mysql提示:Incorrect integer value: for column id at row 1报

mysql提示:Incorrect integer value: for column id at row 1报

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:52:482568browse

也有有些朋友在php中保存数据时会有碰到mysql提示:Incorrect integer value: for column id at row 1报错,其实这是你在设置mysql ie字段时小问题。

解决办法

直接对你的表id设置为自增即可,然后在插入数据时id不管。

或者设置mysql配置

解决办法是更改mysql中的配置 my.ini

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后即可

Statement:
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