This question already has an answer here:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in C:\xampp\htdocs\auction\index.php on line 7
How can I fix this error? This is my code:
<?php
session_start();
$_SESSION['logged'] = 'guest';
require("functions.php");
require("htmls.php");
$query = "SELECT * FROM products WHERE status = 0" or die (mysql_error());
while ($row = mysqli_fetch_array($query))
{
$datenow = date("Y-m-d");
$duedate = $row['duedate'];
$prodid = $row['productid'];
if($datenow >= $duedate){
$query = "UPDATE products SET status = 1 WHERE productid = '$prodid'" or die (mysqli_error());
}
}
$date = date("Y-m-d");
headhtml();
?>
</div>