Whenever I click submit the last value of email fetched is always posted. what should I do to post the current email, and how to post the current email value with the selected status from each table row
<form action="" method="post">
<table>
<tbody>
<?php
while($row=mysqli_fetch_assoc($query))
{
echo '
<tr>
<td style="text-align:center;">
<select name="statuss">
<option selected="selected" disabled="disabled">Select Status</option>
<option value="1">Submitted</option>
<option value="2">Accepted</option>
<option value="3">Questionnaire</option>
<option value="4">Interview</option>
</select>
<input type="text" name="email" value="'.$row['email'].'">
<input type="submit" value="Update" name="submit" class="btn btn-primary">
</td>
</tr>';
}
?>
</tbody>
</table>
</form>
<?php
if(isset($_POST['submit']))
{
$email=(isset($_POST['email']) ? $_POST['email'] : '');
$statuss=(isset($_POST['statuss']) ? $_POST['statuss'] : '');
$sql="update status SET personal_stylist = '$statuss' where email='$email'";
$query=mysqli_query($connection, $sql);
}
?>