fetch data from database and display in dropdownlist

i am trying to fetch a data from my database and display it in my dropdownlist
but i cant get the result i try the other post here but cant understand

anyone can help me with this plssss this is for my project


      $connection =mysqli_connect('localhost', 'root', '','mjj_app');

      $sql="SELECT food FROM menu";

    echo"<select name='fname' id='mySelect' value='Foodname'>"
                        while($food = mysql_fetch_array($lists)) {
   echo '<option value='.$food['food'].'>'.$food['food'].'</option>'; 
    echo '</select>';

Source: css

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.