是否可以导出由mysqli::prepare
and格式化的查询::bind_param
?
例子:
<?php
$mysqli = new mysqli('host', 'user', 'pass', 'table');
if(mysqli_connect_errno()){
printf('Connect failed: %s\n', mysqli_connect_error());
exit;
}
$data=7290;
if ($stmt = $mysqli->prepare('SELECT `id`,`info` FROM `propertys` WHERE id>?')){
$stmt->bind_param('i',$data);
$stmt->execute();
$stmt->bind_result($id,$info);
while($q=$stmt->fetch()){
echo $id,': ',$info,'<br>';
}
$stmt->close();
}
$mysqli->close();
?>
我想导出由等QUERY
执行的功能
(这是一个虚构的例子):mysql::prepare
bind_param
if ($stmt = $mysqli->prepare('SELECT `id`,`info` FROM `propertys` WHERE id>?')){
$stmt->bind_param('i',$data);
$stmt->execute();
echo $stmt->exportQuery();//Function does not exist, just for example
该函数::exportQuery
将像这样打印:
SELECT `id`,`info` FROM `propertys` WHERE id>7290
有什么解决办法吗?
谢谢。