不正确的整数值:“"表示第1行的"id"列 [英] Incorrect integer value: '' for column 'id' 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"列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文