i am using a while loop to display all the data in my MYSQL table. the problem is that its not showing the newest entry. after adding a record it does not show the record in my browser, but it would have been added in the database. it will show after i add another one. i have attached pictures.
Here is my code
<table id="t02" width="100%" border="1px">
<tr>
<th>Ec Number</th>
<th>Username</th>
<th>Email</th>
<th>Phone Number</th>
<th>Department</th>
</tr>
<?php
$sql = "SELECT * FROM lecturer";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
while ($row = $result->fetch_assoc()){
echo "<tr>";
echo "<td>".$row['ecnumber']."</td>";
echo "<td>".$row['username']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['phonenumb']."</td>";
echo "<td>".$row['dept']."</td>";
echo "</tr>";
}
?>
</table>

