I just want to make a table that let me view the list of rows on my database... But my code won't work, here is my whole code:
$con=mysqli_connect("fd***.biz.nf","1549087_admin","*****","******");
$sql = "SELECT * FROM Solo;";
$myData = mysqli_query($con,$sql);
echo "<table border='1'>
<tr>
<th>Grade/Yr. Level</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>Age</th>
<th>Position</th>
<th>Motto</th>
</tr>";
while($row = mysqli_fetch_array($myData, MYSQLI_ASSOC))
{
echo "<tr><td>";
echo $row['gradeyrlevel'];
echo "</tr><td>";
echo $row['firstname'];
echo "</tr><td>";
echo $row['middlename'];
echo "</tr><td>";
echo $row['lastname'];
echo "</tr><td>";
echo $row['age'];
echo "</tr><td>";
echo $row['position'];
echo "</tr><td>";
echo $row['motto'];
echo "</tr><td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
Please help me.
the error is:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /srv/disk10/1549087/www/rooseveltcollegecainta.co.nf/admin/adminpage/index.php on line 125
line 125 is
while($row = mysqli_fetch_array($myData, MYSQLI_ASSOC))