【发布时间】:2018-05-16 10:27:12
【问题描述】:
我正在尝试从 sql 中回显表中的每一件事,我的代码如下
$stmt = $link->prepare("SELECT * FROM articles");
$stmt->execute();
$stmt->store_result();
if (mysqli_stmt_num_rows($stmt) >= 1) {
$result = mysqli_stmt_get_result($stmt); //get result object
while ($row = mysqli_fetch_assoc($result)){ //get associative array
$news = $row['title'];
}
}
不行,返回mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given
我已经完成了我的研究,但实际上没有任何效果:(
【问题讨论】: