Update mysql

This commit is contained in:
Michael RICOIS 2015-05-25 09:03:44 +00:00
parent d5e6c01aee
commit 2b8c13abe4
2 changed files with 32 additions and 22 deletions

View File

@ -133,9 +133,9 @@ class WDB
$this->errorMsg = '';
if ($low_priority)
$query='DELETE LOW_PRIORITY QUICK FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.' LIMIT 1;';
else
$query='DELETE FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE FROM '.$table.' WHERE '.$where.' LIMIT 1;';
if ($debug) $tdeb=microtime_float();
@ -241,7 +241,12 @@ class WDB
} else {
$duree = 'N/D';
}
file_put_contents(LOG_PATH . '/mysql.log', date('Y-m-d H:i:s') ." - ".$query." - ".$this->errorCode.":".$this->errorMsg." - ".$duree."\n", FILE_APPEND);
if ($this->errorCode == 0) {
$msg = date('Y-m-d H:i:s') ." - DEBUG - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
} else {
$msg = date('Y-m-d H:i:s') ." - ERROR - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
}
file_put_contents(LOG_PATH . '/mysql.log', $msg . "\n", FILE_APPEND);
}
/**

View File

@ -133,9 +133,9 @@ class WDB
$this->errorMsg = '';
if ($low_priority)
$query='DELETE LOW_PRIORITY QUICK FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.' LIMIT 1;';
else
$query='DELETE FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE FROM '.$table.' WHERE '.$where.' LIMIT 1;';
if ($debug) $tdeb=microtime_float();
@ -241,7 +241,12 @@ class WDB
} else {
$duree = 'N/D';
}
file_put_contents(LOG_PATH . '/mysql.log', date('Y-m-d H:i:s') ." - ".$query." - ".$this->errorCode.":".$this->errorMsg." - ".$duree."\n", FILE_APPEND);
if ($this->errorCode == 0) {
$msg = date('Y-m-d H:i:s') ." - DEBUG - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
} else {
$msg = date('Y-m-d H:i:s') ." - ERROR - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
}
file_put_contents(LOG_PATH . '/mysql.log', $msg . "\n", FILE_APPEND);
}
/**