diff --git a/src/ORM/Connect/MySQLiConnector.php b/src/ORM/Connect/MySQLiConnector.php index e480f5db9bf..2c60d57ca1f 100644 --- a/src/ORM/Connect/MySQLiConnector.php +++ b/src/ORM/Connect/MySQLiConnector.php @@ -315,7 +315,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) {