Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用绑定参数mysqli函数打印上次执行的查询?_Php_Mysqli_Bindparam - Fatal编程技术网

Php 如何使用绑定参数mysqli函数打印上次执行的查询?

Php 如何使用绑定参数mysqli函数打印上次执行的查询?,php,mysqli,bindparam,Php,Mysqli,Bindparam,我使用bind参数mysqli函数在php中执行查询。但我想每次都打印最后执行的查询 public function __construct(){ $this->dbcon = new mysqli('localhost', '*****', '*****', 'db1'); } public function get_oderlist($email){ $emailid = $this->dbcon->real_escape_string($email);

我使用bind参数mysqli函数在php中执行查询。但我想每次都打印最后执行的查询

public function __construct(){
   $this->dbcon = new mysqli('localhost', '*****', '*****', 'db1');
  }

public function get_oderlist($email){
    $emailid = $this->dbcon->real_escape_string($email);
    $stmt =$this->dbcon->prepare("SELECT order_id,email,phone FROM order_historynew where email=? GROUP BY order_id ORDER BY id DESC"); 
    $stmt->bind_param('s',$emailid);  
    $stmt->execute(); 
    $stmt -> bind_result($order_id,$email,$phone);
    while ($stmt->fetch()) {
        $Oderlist[]=array('Order_id'=>$order_id,'Useremail'=>$email,'Phone'=>$phone);
    }     
    if($Oderlist){
        return $Oderlist;
    }else{
        return false; 
    }       
}  

使用
$sth->debugDumpParams()检查对C:\xampp\htdocs\中未定义的方法mysqli_stmt::debugDumpParams()的调用!2\index.php第12行检查正确答案:-这将有助于:-