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' 的 ''
基础教程推荐
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 无法解决整理冲突 2021-01-01
