你好我试图使用orderby id desc以降序方式对结果进行排序并将结果限制为6但是我得到了这个错误警告:mysqli_fetch_assoc()期望参数1是mysqli_result,在C:\ xampp中给出布尔值第237行的\ htdocs \ my-practice \ cms \ admin \ index.php。 这里是代码`
<?php
$sql2 = "SELECT * FROM comments ORDER BY id DESC LIMIT 6";
$sql_query2 = mysqli_query($conn,$sql2);
while($row2 = mysqli_fetch_assoc($sql_query2)){
echo '
<tr>
<td>'.$row2['id'].'</td>
<td>'.$row2['date'].'</td>
<td><img src="../'.$row2['image'].'" style="width:70px;height: 70px;"></td>
<td>'.$row2['title'].'</td>
<td>'.substr($row2['description'],0,100).'</td>
<td>'.$row2['category'].'</td>
</tr>
';
}
?>
`