diff --git a/db/connection/ConnectionMYS.php b/db/connection/ConnectionMYS.php index 4579c1f..5b72dcb 100644 --- a/db/connection/ConnectionMYS.php +++ b/db/connection/ConnectionMYS.php @@ -75,7 +75,7 @@ class ConnectionMYS extends ConnectionAbstr { if(!mysqli_stmt_execute($prepStmt)){ throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". \mysqli_stmt_error($prepStmt));} - return new ResultMysqliPrepare($prepStmt,$this); + return new \SYSTEM\DB\ResultMysqliPrepare($prepStmt,$this); } /** @@ -88,7 +88,7 @@ class ConnectionMYS extends ConnectionAbstr { $result = \mysqli_query($this->connection, $query); if(!$result){ throw new \Exception('Could not query Database. Check ur Query Syntax or required Rights: '.\mysqli_error($this->connection));} - return $result === true ? $result : new ResultMysqli($result); + return $result === true ? $result : new \SYSTEM\DB\ResultMysqli($result); } /** diff --git a/db/result/ResultAMQP.php b/db/result/ResultAMQP.php index a74abd2..ce378a3 100644 --- a/db/result/ResultAMQP.php +++ b/db/result/ResultAMQP.php @@ -65,7 +65,7 @@ class ResultAMQP extends \SYSTEM\DB\Result{ // < maybe not ? check if amqpchanne * @param int $result_type Mysql Fetch result Type * @return array Returns an array(object) containing the next line */ - public function next($object = false, $result_type = MYSQL_BOTH){ + public function next($object = false, $result_type = MYSQLI_BOTH){ if($object){ $this->current = pg_fetch_object($this->res); } else { diff --git a/db/result/ResultMysqli.php b/db/result/ResultMysqli.php index 258cd03..c36216e 100644 --- a/db/result/ResultMysqli.php +++ b/db/result/ResultMysqli.php @@ -65,7 +65,7 @@ class ResultMysqli extends \SYSTEM\DB\Result{ * @param int $result_type Mysql Fetch result Type * @return array Returns an array(object) containing the next line */ - public function next($object = false, $result_type = MYSQL_BOTH){ + public function next($object = false, $result_type = MYSQLI_BOTH){ if($object){ $this->current = mysqli_fetch_object($this->res); } else { diff --git a/db/result/ResultMysqliPrepare.php b/db/result/ResultMysqliPrepare.php index 86cdb07..cc1c51b 100644 --- a/db/result/ResultMysqliPrepare.php +++ b/db/result/ResultMysqliPrepare.php @@ -41,12 +41,15 @@ class ResultMysqliPrepare extends \SYSTEM\DB\Result{ //throw new \Exception("Could not retrieve meta for prepare statement");} return;} + $ref = []; while ($field = $this->meta->fetch_field() ) { - $this->binds[$field->table.'.'.$field->name] = &$this->binds[$field->table.'.'.$field->name];} //fix for ambiguous fieldnames + $this->binds[$field->table.'.'.$field->name] = &$this->binds[$field->table.'.'.$field->name]; + $ref[$field->table.'.'.$field->name] = &$this->binds[$field->table.'.'.$field->name]; + } //fix for ambiguous fieldnames \mysqli_free_result($this->meta); - call_user_func_array(array($this->res, 'bind_result'), $this->binds); //you need 2 append the parameters - thats the right way to do that. + call_user_func_array(array($this->res, 'bind_result'), $ref); //you need 2 append the parameters - thats the right way to do that. $this->res->store_result(); } @@ -88,7 +91,7 @@ class ResultMysqliPrepare extends \SYSTEM\DB\Result{ * @param int $result_type Mysql Fetch result Type * @return array Returns an array(object) containing the next line */ - public function next($object = false, $result_type = MYSQL_BOTH){ + public function next($object = false, $result_type = MYSQLI_BOTH){ if(\mysqli_stmt_fetch($this->res)){ foreach( $this->binds as $key=>$value ){ $row[substr($key, strpos($key, '.')+1)] = $value;} //fix for ambiguous fieldnames diff --git a/log/error_handler/error_handler.php b/log/error_handler/error_handler.php index 9e7c81e..3c02a15 100644 --- a/log/error_handler/error_handler.php +++ b/log/error_handler/error_handler.php @@ -22,5 +22,5 @@ interface error_handler { * @param bool $thrown Was the Exception thrown? * @return bool Returns true or false. */ - static function CALL(\Exception $E, $thrown); + static function CALL($E, $thrown); } \ No newline at end of file diff --git a/log/error_handler/error_handler_dbwriter.php b/log/error_handler/error_handler_dbwriter.php index 3804ecb..687edcc 100644 --- a/log/error_handler/error_handler_dbwriter.php +++ b/log/error_handler/error_handler_dbwriter.php @@ -23,7 +23,7 @@ class error_handler_dbwriter implements \SYSTEM\LOG\error_handler { * @param bool $thrown Was the Exception thrown? * @return bool Returns true or false. */ - public static function CALL(\Exception $E, $thrown){ + public static function CALL($E, $thrown){ try{ $result = \SYSTEM\SQL\SYS_LOG_INSERT::QI(array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), diff --git a/log/error_handler/error_handler_jsonoutput.php b/log/error_handler/error_handler_jsonoutput.php index acbe324..26e4b60 100644 --- a/log/error_handler/error_handler_jsonoutput.php +++ b/log/error_handler/error_handler_jsonoutput.php @@ -23,7 +23,7 @@ class error_handler_jsonoutput implements \SYSTEM\LOG\error_handler { * @param bool $thrown Was the Exception thrown? * @return bool Returns true or false. */ - public static function CALL(\Exception $E, $thrown){ + public static function CALL($E, $thrown){ if($thrown){ try{ echo \SYSTEM\LOG\JsonResult::error($E); diff --git a/log/log.php b/log/log.php index 6a52127..79ef3ab 100644 --- a/log/log.php +++ b/log/log.php @@ -46,7 +46,7 @@ class log { * @param bool $thrown Was the Exception thrown? * @return bool Returns true or false. */ - private static function call_handlers(\Exception $E, $thrown = true){ + private static function call_handlers($E, $thrown = true){ foreach(self::$handlers as $handler){ if( \call_user_func_array(array($handler,self::HANDLER_FUNC_CALL),array($E, $thrown))){ return true;}} @@ -59,7 +59,7 @@ class log { * @param bool $thrown Was the Exception thrown? * @return bool Returns true or false depending on thrown */ - public static function __exception_handler(\Exception $E, $thrown = true){ + public static function __exception_handler($E, $thrown = true){ return self::call_handlers($E, $thrown) && $thrown;} /**