im trying a basic thing but there is some problem with my query, Im trying to populate names in a dropdown where status = Arrived, however the query doesn't work with where clause, neither giving any syntax error. Here is my code:
$sql= mysqli_query($con,"Select name from reservations where status='Arrived'");
$result=mysqli_fetch_assoc($sql);
echo "<select name=\"name\">";
while($row = mysqli_fetch_array($sql))
{
echo "<option value='".$row['name']."'>".$row['name']."</option>";
}
echo "</select>";
?>