diff --git a/db/zm_update-1.31.5.sql b/db/zm_update-1.31.5.sql index 859487e88..d315c8e84 100644 --- a/db/zm_update-1.31.5.sql +++ b/db/zm_update-1.31.5.sql @@ -10,7 +10,7 @@ SET @s = (SELECT IF( AND column_name = 'ParentId' ) > 0, "SELECT 'Column GroupId exists in Groups'", -"ALTER TABLE Groups ADD `ParentId` int(10) unsigned AFTER `Name`" +"ALTER TABLE `Groups` ADD `ParentId` int(10) unsigned AFTER `Name`" )); PREPARE stmt FROM @s; diff --git a/db/zm_update-1.31.7.sql b/db/zm_update-1.31.7.sql index 1221d9adb..0afd76ce5 100644 --- a/db/zm_update-1.31.7.sql +++ b/db/zm_update-1.31.7.sql @@ -3,7 +3,7 @@ SET @s = (SELECT IF( AND table_name = 'Groups' AND column_name = 'MonitorIds' ) > 0, - "ALTER TABLE Groups MODIFY `MonitorIds` text NOT NULL", + "ALTER TABLE `Groups` MODIFY `MonitorIds` text NOT NULL", "SELECT 'Groups no longer has MonitorIds'" )); diff --git a/web/includes/database.php b/web/includes/database.php index 3eea672a6..6835daa64 100644 --- a/web/includes/database.php +++ b/web/includes/database.php @@ -128,7 +128,7 @@ function dbEscape( $string ) { return $dbConn->quote($string); } -function dbQuery($sql, $params=NULL) { +function dbQuery($sql, $params=NULL, $debug = false) { global $dbConn; if ( dbLog($sql, true) ) return; @@ -145,7 +145,7 @@ function dbQuery($sql, $params=NULL) { return NULL; } } else { - if ( defined('ZM_DB_DEBUG') ) { + if ( defined('ZM_DB_DEBUG') or $debug ) { ZM\Debug("SQL: $sql values:" . ($params?implode(',',$params):'')); } $result = $dbConn->query($sql); @@ -154,7 +154,7 @@ function dbQuery($sql, $params=NULL) { return NULL; } } - if ( defined('ZM_DB_DEBUG') ) { + if ( defined('ZM_DB_DEBUG') or $debug ) { ZM\Debug('SQL: '.$sql.' '.($params?implode(',',$params):'').' rows: '.$result->rowCount()); } } catch(PDOException $e) {