By parkej60 on
I've created a table which has a unique ID field to keep duplicate entries from being entered. However when a duplicate entry is attempted to be added the drupal mysql_error function takes over and places the big red error on the page.
Is there a way I can catch this error and have it print a drupal_set_message function instead? The db_error() function doesn't seem to be working, it always returns a 0.
Thanks in advance for any help