简体   繁体   中英

MySQL When Inserting Row Column Value Is The Same For Every Row

I have a mysql table for keeping track of books. When i try to enter a new book the EAN column only keeps the initial value that was inserted into the table.

MySQL表描述 I am using insert statements like this:

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. The EAN for every book is the same in the table but the value was not the same when I added the book.

Can you try removing the quotes around the EAN value? Looks like you're trying to write a string to an INT column.

Similar to the other StackOverflow answer here , it looks like your EAN values are too big for an INT field. (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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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