简体   繁体   English

插入行列时的MySQL对于每一行都是相同的

[英]MySQL When Inserting Row Column Value Is The Same For Every Row

I have a mysql table for keeping track of books. 我有一个用于跟踪书籍的mysql表。 When i try to enter a new book the EAN column only keeps the initial value that was inserted into the table. 当我尝试输入新书时,EAN列仅保留插入表中的初始值。

MySQL表描述 I am using insert statements like this: 我正在使用这样的insert语句:

INSERT INTO `Books` (`EAN`, `ISBN13`, `ISBN10`, `ASIN`, `Title`, `author`, `imprint`, `price`) VALUES ('9781633669783','','','','[Title]','[Author]','[imprint]','');
INSERT INTO `Books` (`EAN`, `ISBN13`, `ISBN10`, `ASIN`, `Title`, `author`, `imprint`, `price`) VALUES (9781633669783,'','','','[Title]','[Author]','[imprint]','');

When I try to insert a book all of the info gets inserted correctly except for the EAN column. 当我尝试插入一本书时,除了EAN列之外,所有信息都被正确插入。 The EAN for every book is the same in the table but the value was not the same when I added the book. 每本书的EAN在表格中是相同的,但是当我添加这本书时,价值并不相同。

Can you try removing the quotes around the EAN value? 您可以尝试删除EAN值周围的引号吗? Looks like you're trying to write a string to an INT column. 看起来你正在尝试将字符串写入INT列。

Similar to the other StackOverflow answer here , it looks like your EAN values are too big for an INT field. 此处的其他StackOverflow答案类似,看起来您的EAN值对于INT字段来说太大了。 (INT has a max value of 2,147,483,647) You might want to try switching the field to another type such as a BIGINT. (INT的最大值为2,147,483,647)您可能希望尝试将字段切换为另一种类型,例如BIGINT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM