I have set up a data base called assignment with a table called 'Parts' in it. But when i run the follwoing code on my local host i get the following error "Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /Applications/XAMPP/xamppfiles/htdocs/lab9.php on line 8". Can anyone help me fix this and help me print out the contents of the table.
<html>
<head>
<?php
$con = mysqli_connect("localhost", "root","","Assignment");
echo '<table border="1">'."\n";
$result = mysqli_query($con,"SELECT * FROM user");
while ( $row = mysqli_fetch_array($result))
{
echo("</tr><td>");
echo(htmlentities($row[0]));
echo("</td><td>");
echo(htmlentities($row[1]));
echo("</td><td>");
echo(htmlentities($row[2]));
echo("</td><td>");
echo(htmlentities($row[3]));
echo("</td><td>");
echo(htmlentities($row[4]));
echo("</td><td>\n");
echo('<a href="edit.php?id=' .htmlentities($row[0]).' ">Edit</a> /');
echo('<a href="delete.php?id=' .htmlentities($row[0]).' ">Delete</a> ');
echo("</td></tr>\n");
}
mysqli_close($con);
?>
</table>
<a href="add.php">Add New</a>