A beginner tutorial here is looking for advice ...
I have a very simple PHP query for a MySQL database, which is supposed to create a drop down menu populated with information from a MySQL database. I was wondering if, based on the code included in this post, someone could point me in the right direction or give me a suggestion on what I should do.
Ps MySQL database - these are the products that I select from the inside - these are the products, and the column that I am trying to select is the description.
<?php
$adConn = mysqli_connect("localhost", "user", "password", "products");
$result = "SELECT * FROM products where Description order by descending";
$result = mysqli_query($adConn, $result);
echo "<select name='product'>";
while ($row = mysql_fetch_array($result))
{
echo "<option value='" . $row['Description'] . "'>" . $row['Description'] . "</option>";
}
echo "</select>";
?>
source
share