Hi
Does anyone know how I would catch a duplicate key error 1062, thrown by MySQL?
I’m trying to import data into the EE database automatically, upon receipt from an external source, but I obviously don’t want to import the same data twice, hence I’m adding a unique key based on the data row to be inserted.
The 1062 error is thrown before testing with
if($this-EE->db-query($sql)) { ...I’ve tried to catch the error by using
if (mysql_errno() == 1062) {...and setting
$db['expressionengine']['db_debug'] = FALSE;in config/database.php, but this has no effect. I’m still getting the error being thrown before anything else.
Does anyone know how to handle this?
Thanks in advance.
~ Steve
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.