in reply to Handling a Database Error

If you are using MySQL, just add IGNORE to the INSERT, ie INSERT IGNORE INTO table_name - if the key already exists the INSERT will be silently ignored.

jdtoronto