Mysql Insert Ignore – Ignoring Insert Errors

In the MySQL sql language, the insert modifier ignore can sometimes come in handy if you’re wanting to run the query but not worry about errors in your code. In this example below, if the id column is a primary key and a row with 45 already exists, this statement would error without the ignore modifier. Instead, the statement fails silently and any coding you do won’t toss an error.