fixed jsonresult html entities, connectionpg now logs notice if present
This commit is contained in:
parent
4989aae171
commit
2b0486d9e9
@ -24,12 +24,16 @@ class ConnectionPG extends ConnectionAbstr {
|
|||||||
//var_dump($values);
|
//var_dump($values);
|
||||||
if (pg_num_rows($result) == 0) {
|
if (pg_num_rows($result) == 0) {
|
||||||
$result = \pg_prepare($this->connection, $stmtName, $stmt);
|
$result = \pg_prepare($this->connection, $stmtName, $stmt);
|
||||||
|
if(($info = \pg_last_notice($this->connection)) != ''){
|
||||||
|
new \SYSTEM\LOG\INFO($info);}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$result)
|
if(!$result)
|
||||||
throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. \pg_last_error($this->connection));
|
throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. \pg_last_error($this->connection));
|
||||||
|
|
||||||
$result = \pg_execute($this->connection, $stmtName, $values);
|
$result = \pg_execute($this->connection, $stmtName, $values);
|
||||||
|
if(($info = \pg_last_notice($this->connection)) != ''){
|
||||||
|
new \SYSTEM\LOG\INFO($info);}
|
||||||
|
|
||||||
if(!$result)
|
if(!$result)
|
||||||
throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". \pg_last_error($this->connection));
|
throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". \pg_last_error($this->connection));
|
||||||
@ -41,7 +45,10 @@ class ConnectionPG extends ConnectionAbstr {
|
|||||||
return pg_close($this->connection);}
|
return pg_close($this->connection);}
|
||||||
|
|
||||||
public function query($query){
|
public function query($query){
|
||||||
$result = pg_query($this->connection, $query);
|
$result = \pg_query($this->connection, $query);
|
||||||
|
if(($info = \pg_last_notice($this->connection)) != ''){
|
||||||
|
new \SYSTEM\LOG\INFO($info);}
|
||||||
|
|
||||||
if(!$result){
|
if(!$result){
|
||||||
throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.pg_last_error($this->connection));}
|
throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.pg_last_error($this->connection));}
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class JsonResult extends \SYSTEM\LOG\AbstractResult {
|
|||||||
$error = array();
|
$error = array();
|
||||||
|
|
||||||
$error['class'] = get_class($e);
|
$error['class'] = get_class($e);
|
||||||
$error['message'] = htmlentities($e->getMessage());
|
$error['message'] = $e->getMessage();
|
||||||
$error['code'] = $e->getCode();
|
$error['code'] = $e->getCode();
|
||||||
$error['file'] = $e->getFile();
|
$error['file'] = $e->getFile();
|
||||||
$error['line'] = $e->getLine();
|
$error['line'] = $e->getLine();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user