更新时间:2023-02-21 15:47:36
不幸的是,mysqli
没有一个很好的方法来获取查询.您可以使用一种方法来替换参数:
Unfortunately, mysqli
does not have a good way to get just the query. You could use a method to do the replacement of your parameters:
function populateSql ( string $sql, array $params ) : string {
foreach($params as $value)
$sql = preg_replace ( '[\?]' , "'" . $value . "'" , $sql, 1 );
return $sql;
}