$result = $mysqli->query("SELECT * FROM news");
$news = $result->fetch_assoc();
$data = "test";
$query = "UPDATE news SET last_query = UNIX_TIMESTAMP(), news = ?";
$stmt = $mysqli->prepare($query);
var_dump($mysqli->error); # empty
var_dump($stmt->bind_param("s", $data)); # true
var_dump($stmt->prepare($query)); # true
var_dump($stmt->execute()); # false
var_dump($stmt->error); # No data supplied for parameters in prepared statement
$stmt->close();
删除第一个查询会导致第二个查询正常运行,因为我从结果集中剩余的结果中读取(即使它是从单行数据库中读取)。但即使使用 $result->free(); 清除结果集;似乎没有解决它。