KMatle Expert Licensed User Longtime User Dec 12, 2018 #1 Hi guys, with Code: Copy mysqli_error($con) you can get a SQL error message like this Code: Copy Duplicate entry '[email protected]' for key 'email'} I did not find a function to get the columnname and value involved and I don't like to parse strings which can change some day. Any ideas? (maybe I was to blind to find anything on the www)
Hi guys, with Code: Copy mysqli_error($con) you can get a SQL error message like this Code: Copy Duplicate entry '[email protected]' for key 'email'} I did not find a function to get the columnname and value involved and I don't like to parse strings which can change some day. Any ideas? (maybe I was to blind to find anything on the www)
K keirS Well-Known Member Licensed User Longtime User Dec 14, 2018 #2 One way is to use ON DUPLICATE KEY UPDATE and populate a different column with the failed update field. The better option is to use a stored procedure to do the insert and use a DECLARE HANDLER to return the duplicate fields.
One way is to use ON DUPLICATE KEY UPDATE and populate a different column with the failed update field. The better option is to use a stored procedure to do the insert and use a DECLARE HANDLER to return the duplicate fields.