Whitespace

This commit is contained in:
Isaac Connor 2021-11-09 10:49:01 -05:00
parent dd542d5b30
commit 55e739d4ea
1 changed files with 5 additions and 5 deletions

View File

@ -112,7 +112,7 @@ function dbLog($sql, $update=false) {
function dbError($sql) { function dbError($sql) {
global $dbConn; global $dbConn;
$error = $dbConn->errorInfo(); $error = $dbConn->errorInfo();
if ( !$error[0] ) if (!$error[0])
return ''; return '';
$message = "SQL-ERR '".implode("\n", $dbConn->errorInfo())."', statement was '".$sql."'"; $message = "SQL-ERR '".implode("\n", $dbConn->errorInfo())."', statement was '".$sql."'";
@ -130,17 +130,17 @@ function dbEscape( $string ) {
function dbQuery($sql, $params=NULL, $debug = false) { function dbQuery($sql, $params=NULL, $debug = false) {
global $dbConn; global $dbConn;
if ( dbLog($sql, true) ) if (dbLog($sql, true))
return; return;
$result = NULL; $result = NULL;
try { try {
if ( isset($params) ) { if (isset($params)) {
if ( ! $result = $dbConn->prepare($sql) ) { if (!$result = $dbConn->prepare($sql)) {
ZM\Error("SQL: Error preparing $sql: " . $pdo->errorInfo); ZM\Error("SQL: Error preparing $sql: " . $pdo->errorInfo);
return NULL; return NULL;
} }
if ( ! $result->execute($params) ) { if (!$result->execute($params)) {
ZM\Error("SQL: Error executing $sql: " . print_r($result->errorInfo(), true)); ZM\Error("SQL: Error executing $sql: " . print_r($result->errorInfo(), true));
return NULL; return NULL;
} }