fix mysql prepare
This commit is contained in:
parent
5a69cce755
commit
83eafbeb17
@ -41,16 +41,15 @@ class ResultMysqliPrepare extends \SYSTEM\DB\Result{
|
|||||||
//throw new \Exception("Could not retrieve meta for prepare statement");}
|
//throw new \Exception("Could not retrieve meta for prepare statement");}
|
||||||
return;}
|
return;}
|
||||||
|
|
||||||
$ref = [];
|
|
||||||
while ($field = $this->meta->fetch_field() ) {
|
while ($field = $this->meta->fetch_field() ) {
|
||||||
$this->binds[$field->table.'.'.$field->name] = &$this->binds[$field->table.'.'.$field->name];
|
$ref = $field->table.'.'.$field->name;
|
||||||
$ref[$field->table.'.'.$field->name] = &$this->binds[$field->table.'.'.$field->name];
|
$$ref = null;
|
||||||
|
$this->binds[$ref] = &$$ref;
|
||||||
} //fix for ambiguous fieldnames
|
} //fix for ambiguous fieldnames
|
||||||
|
|
||||||
\mysqli_free_result($this->meta);
|
\mysqli_free_result($this->meta);
|
||||||
|
|
||||||
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->bind_result(...array_values($this->binds));
|
||||||
$this->res->store_result();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -65,8 +64,8 @@ class ResultMysqliPrepare extends \SYSTEM\DB\Result{
|
|||||||
* @return null Returns null
|
* @return null Returns null
|
||||||
*/
|
*/
|
||||||
public function close(){
|
public function close(){
|
||||||
mysqli_stmt_free_result($this->res);
|
\mysqli_stmt_free_result($this->res);
|
||||||
return mysqli_stmt_close($this->res);}
|
return \mysqli_stmt_close($this->res);}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts the Lines in the Resultset
|
* Counts the Lines in the Resultset
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user