I want to echo all of the data that contains the selected option but every time I echo those data, I only get one.
the select is use for filtering the search, here's my code
<select class = "grade" name = "grade">
<option value ="" >=====Grade=====</option>
<option value ="Grade11">Grade 11</option>
<option value ="Grade12">Grade 12</option>
</select>
<input type="submit" name="search" value= "Submit">
</div>
<div class = "records">
<table width ="600" border = "1" cellpadding ="1" cellspacing ="1">
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Middle Name</th>
</tr>
</table>
<?php
if (isset($_POST['search'])) {
$grade =$_POST['grade'];
$sql = "SELECT * FROM student WHERE grade ='$grade'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
echo "<tr>";
echo "<td>".$row['lname']."</td>";
echo "</tr>";
}