📌  相关文章
📜  mysqli_fetch_all() 期望参数 1 为 mysqli_result,布尔值在 C:\xampp\htdocs\complete-blog-php\admin\includes\post_functions.php 第 31 行给出 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:42.089000             🧑  作者: Mango

代码示例2
mysqli_fetch_array()'s 1st parameter must be a result of a query. What you are doing is you are passing the connection (which doesn't make sense) and the query command itself.

To fix this, execute the query first, then store the result to a variable then later fetch that variable.

$sql = "select * from privinsi";
$result = mysqli_query($connection,$sql);
while($r = mysqli_fetch_array($result))
{
    // your code here
}