This commit is contained in:
2023-01-11 22:05:02 +01:00
parent 777fa8ffad
commit b0e98033b4
5 changed files with 61 additions and 27 deletions

View File

@@ -201,7 +201,10 @@ class MySQL extends SQL {
}
}
} catch (\mysqli_sql_exception $exception) {
$this->lastError = $this->logger->error("MySQL::execute failed: $stmt->error ($stmt->errno)");
$this->lastError = $this->logger->error("MySQL::execute failed: " .
($stmt !== null
? "$stmt->error ($stmt->errno)"
: $exception->getMessage()));
} finally {
if ($res !== null && !is_bool($res) && $fetchType !== self::FETCH_ITERATIVE) {