`
$sql = "SELECT * FROM tbl_feedback where status='Pending'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$i=1;
// output data of each row
while($row = $result->fetch_assoc()) {
$loc=$row['location'];
$inci=$row['incident'];
$sol=$row['solution'];
echo "<tr>
<td>
<a href=editrecipient.php?feed_id=" . $row['feed_id'] . "><button type=button class='btn btn-info btn-xs' data-toggle='tooltip' data-placement='left' title='Edit'><i class='fa fa-pencil'></i></button></a>
<a href=recprofile.php?feed_id=" . $row['feed_id'] . "><button type=button class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='right' title='Delete'><i class='fa fa-trash'></i></button></a>
</td>
<td>$i</td>
<td>$loc</td>
<td>$inci</td>
<td>$sol</td>
<td><button type='button' class='btn btn-default btn-xs'>Post Feedback</button></td>
</tr>";
$i++;
}
} else {
echo "0 results";
}
$conn->close();
?>
` 这是错误消息 警告:mysqli :: query():无法在第222行的C:\ xampp2 \ htdocs \ Sahana \ residentfeedback.php中获取mysqli
注意:尝试在第224行的C:\ xampp2 \ htdocs \ Sahana \ residentfeedback.php中获取非对象的属性 0结果 警告:mysqli :: close():无法在第252行的C:\ xampp2 \ htdocs \ Sahana \ residentfeedback.php中获取mysqli
答案 0 :(得分:0)
我相信在查询之后立即添加close语句有一些规则,但我似乎无法找到它。
尝试添加$ result-&gt; close();在sql执行之后。