Php 如何使用绑定参数mysqli函数打印上次执行的查询?
我使用bind参数mysqli函数在php中执行查询。但我想每次都打印最后执行的查询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);
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行检查正确答案:-这将有助于:-