The database name is sloganstreet and the table is slogan, and the column i'm trying to pull from is called text. Any help would be appreciated. I have established the connection to the database but I can't seem to get the dropdown to populate with the info from mysql. thanks.
<label>Select a slogan:</label>
<select name="select_slogan">
<?php
$query = "SELECT text from slogansstreet";
$result = mysqli_query($conn, $query);
echo "<select name='Slogan'>";
echo "<option value='0'>-Select-</option>";
while($row = mysqli_fetch_array($result))
{
echo "<option value='".$row['text']."'></option>";
}
echo "</select>";
?>
<option></option>, you only assign a value (which is hidden to the user). You also likely wantmysqli_fetch_associnstead ofmysqli_fetch_array(based on how you use the index).