diff --git a/includes/dbFacile.php b/includes/dbFacile.php index 1f18c1a6fd..1ff1732f0c 100644 --- a/includes/dbFacile.php +++ b/includes/dbFacile.php @@ -24,10 +24,10 @@ Usage function dbQuery($sql, $parameters = array()) { global $fullSql, $debug; $fullSql = dbMakeQuery($sql, $parameters); - if($debug) { - print Console_Color::convert("\nSQL[%y".$fullSql."%n] "); - #echo("\nSQL[".$fullSql."] "); - } + //if($debug) { + //print Console_Color::convert("\nSQL[%y".$fullSql."%n] "); + //echo("\nSQL[".$fullSql."] "); + //} /* if($this->logFile) @@ -35,6 +35,10 @@ function dbQuery($sql, $parameters = array()) { */ $result = mysql_query($fullSql); // sets $this->result + if (!empty(mysql_error())) { + echo("\nSQL[".$fullSql."] "); + print mysql_error(); + } /* if($this->logFile) { $time_end = microtime(true); @@ -114,9 +118,9 @@ function dbUpdate($data, $table, $where = null, $parameters = array()) { // need field name and placeholder value // but how merge these field placeholders with actual $parameters array for the WHERE clause - $sql = 'UPDATE `' . $table . '` set '; + $sql = 'UPDATE `' . $table . '` SET '; foreach($data as $key => $value) { - $sql .= "`".$key."` ". '=:' . $key . ','; + $sql .= "`".$key."` = '" . $value . "',"; } $sql = substr($sql, 0, -1); // strip off last comma