Index: branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php =================================================================== diff -u -r4255 -r4500 --- branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php (.../db_connection.php) (revision 4255) +++ branches/unlabeled/unlabeled-1.7.2/core/kernel/db/db_connection.php (.../db_connection.php) (revision 4500) @@ -68,6 +68,13 @@ var $debugMode=false; /** + * Last query to database + * + * @var string + */ + var $lastQuery = ''; + + /** * Initializes connection class with * db type to used in future * @@ -332,6 +339,7 @@ */ function Query($sql,$key_field = null) { + $this->lastQuery = $sql; if($this->debugMode) return $this->debugQuery($sql,$key_field); $query_func = $this->getMetaFunction('query'); $this->queryID = $query_func($sql,$this->connectionID); @@ -557,6 +565,8 @@ function doUpdate($fields_hash, $table, $key_clause) { + if (!$fields_hash) return true; + $fields_sql = ''; foreach ($fields_hash as $field_name => $field_value) { $fields_sql .= '`'.$field_name.'` = '.$this->qstr($field_value).',';