I am trying to select the table, but it show
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
My code:
<?php
require 'database/db.php';
$fetch = $mysqli->query("SELECT * FROM buyhistory WHERE email = xxx@hotmail.com ORDER BY user_id DESC ");
while($row = mysqli_fetch_array($fetch))
{
echo "<tr>";
echo "<td>" . $row['purchasedate'] . "</td>";
echo "<td>" . $row['buyitem'] . "</td>";
echo "<td>" . $row['enddate'] . "</td>";
echo "</tr>";
}
?>
How to fix it?