diff --git a/library/framework/common/mysql.php b/library/framework/common/mysql.php index 8f93c154..21d265cc 100644 --- a/library/framework/common/mysql.php +++ b/library/framework/common/mysql.php @@ -23,7 +23,7 @@ class WDB } if ( $host === null ) { - $c = Zend_Registry::get('config'); + $c = Zend_Registry::get('config'); $config = new Zend_Config(array( 'adapter' => $c->profil->db->metier->adapter, 'params' => array( @@ -122,7 +122,7 @@ class WDB $query='UPDATE `'.$table.'` SET '; while(isset($fields[$i])){ if($i>0) { $query.=', '; } - $query.=' `'.$fields[$i]."`='".checkaddslashes($values[$i])."'"; + $query.=' '.$fields[$i]."='".$this->db->quote($values[$i])."'"; $i++; } $query = str_replace("'NULL'", 'NULL', $query); @@ -205,11 +205,7 @@ class WDB } catch(Zend_Db_Exception $e) { $this->errorCode = $e->getCode(); $this->errorMsg = $e->getMessage(); - - $fpErr = fopen(LOG_PATH.'/sqlerror.log','a'); - fwrite($fpErr, date('YmdHis'). ' - '.$query .EOL); - fwrite($fpErr, date('YmdHis'). ' - '.$e->getCode().' - '. $e->getMessage().PHP_EOL); - + file_put_contents(LOG_PATH.'/sqlerror.log', date('YmdHis')." - ".$query."\n".$e->getCode().':'. $e->getMessage()); return false; }