How to treat Mysql Error with unique constraint violation July 03, 2020, 01:31:00 AM I have a unique constraint in one of my tables in the database.UNIQUE KEY `url_de_busca` (`url_de_busca`,`id_usuarios`),This unique constraint forbids that two rows have the same values in these two fields.When the user inserts a value that is already in the database, the following error appearsThe error is correct, but I want to know how can I show a friendly error screen. How can I do that? Quote Selected
Re: How to treat Mysql Error with unique constraint violation Reply #1 – July 04, 2020, 02:48:19 PM @claudiomg you can write your custom PHP code in Page Events, Action Before Add for the page you are working on, to check the values before adding it and alerting an error message to the user. Please also check the View Helper for PHP functions and variables to use. Quote Selected