mysql - SQL Query Not Adding New Entries With INSERT IGNORE INTO -


so have script gets data 100 items @ time , inserts them mysql database command this:

insert ignore beer(name, type, alcohol_by_volume, description, image_url) values('bourbon barrel porter', 2, '9.1', '', '') 

i ran script once, , populated db 100 entries. however, ran script again same sql syntax, gathering new data (i.e., no duplicates), database not reflecting new entries -- same 100 entries inserted on first iteration of script.

i logged queries, , can confirm queries making requests new data, it's not problem in script not gathering new data.

the name field unique field, no other fields are. missing something?

if use ignore keyword, errors occur while executing insert statement treated warnings instead. example, without ignore, row duplicates existing unique index or primary key value in table causes duplicate-key error , statement aborted. ignore, row still not inserted, no error issued.

if there no primary key, there can't duplicate key ignore. should set primary key, please - , if want have additional colums shouldn't duplicate, set them "unique".


Comments