diff --git a/src/ORM/Connect/MySQLiConnector.php b/src/ORM/Connect/MySQLiConnector.php index 2fbbd70c5d1..dddb2d333e3 100644 --- a/src/ORM/Connect/MySQLiConnector.php +++ b/src/ORM/Connect/MySQLiConnector.php @@ -306,7 +306,12 @@ public function preparedQuery($sql, $parameters, $errorLevel = E_USER_ERROR) } // Safely execute the statement - $statement->execute(); + try { + $statement->execute(); + } catch (mysqli_sql_exception $e) { + $success = false; + $this->databaseError($e->getMessage(), E_USER_ERROR, $sql, $parameters); + } } if (!$success || $statement->error) {