title: How to avoid duplicate entries in a MySQL database without throwing an error
body: <p>I am using the Python-MySQL (MySQLdb) library to insert values into a database. I want to avoid duplicate entries from being inserted into the database, so I have added the <code>unique</code> constraint to that column in MySQL. I am checking for duplicates in the <code>title</code> column. In my Python script, I am using the following statement:</p>
  
  <pre><code>cursor.execute ("""INSERT INTO `database` (title, introduction) VALUES (%s, %s)""", (title, pure_introduction))
  </code></pre>
  
  <p>Now when a duplicate entry is added to the database, it will produce an error. I do not want an error message to appear; I just want that if a duplicate entry is found then it should simply not enter that value into the database. How do I do this?</p>