I am trying to populate an html select statement with data from a column in a SQL table. The following is the code I am trying to use. The problem is that nothing from my SQL table shows up in my html select.
<p>
<select name="animal_Groups">
<?php
$con = mysqli_connect("SERVER1","t_user","passwordsAreFun","t_dev");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT [Group] FROM All_Animals");
while ($row = mysqli_fetch_array($result)) {
// echo '<option value="'. $row['value'] .'">'. $row['name'] .'</option>';
echo '<option value="'. $row['value'] .'">'. $row['value'] .'</option>';
}
mysqli_close($con);
?>
</select>
</p>
Thank you for looking and answers!!! The output that is generated is an empty html select option. It expands but has nothing filling it.
Here is a shot of my sql table (it was originally imported from an Access DB):