Incorrect integer value: #39;#39; for column #39;id#39; at row 1(不正确的整数值:第 1 行的列 id 的 )
问题描述
我正在尝试插入我的 mySQL 数据库.第一列是id"列,因为它是一个 auto_increment 字段,所以我将其留空.出于某种原因,我无法插入,并且收到下面提到的错误.感谢您对此提供的任何帮助.
I am trying to insert into my mySQL database. The first column is the 'id' column, since its an auto_increment field, I left it blank. For some reason, I am unable to insert and I am getting the error mentioned below. I appreciate any help with this.
我在尝试插入时收到以下错误:
I am getting the following error while trying to insert:
Incorrect integer value: '' for column 'id' at row 1
我的查询
$insertQuery = "INSERT INTO workorders VALUES('', '$priority', '$requestType', '$purchaseOrder', '$nte', '$jobSiteNumber')";
推荐答案
这可能意味着你的 id
是一个 AUTO_INCREMENT
整数并且你正在尝试发送一个字符串.您应该指定一个列列表并从 INSERT
中省略它.
That probably means that your id
is an AUTO_INCREMENT
integer and you're trying to send a string. You should specify a column list and omit it from your INSERT
.
INSERT INTO workorders (column1, column2) VALUES ($column1, $column2)
这篇关于不正确的整数值:第 1 行的列 'id' 的 ''的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:不正确的整数值:第 1 行的列 'id' 的 ''


- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- SQL 临时表问题 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01