PHP- Fetch from database and store in drop down menu html

后端 未结 4 1609
礼貌的吻别
礼貌的吻别 2020-12-19 19:01

I can\'t seem to get the following code to make a dropdown menu that contains data from a mysql database. The \"include(\'connect.php\');\" connects to the mysql database an

4条回答
  •  一生所求
    2020-12-19 19:30

    ";
    while($r = mysql_fetch_array($result)) {
      echo ""; 
    }
    echo "";
    ?>
    

    From the looks of things, you're missing an opening option tag, so it's just outputting "Dropdown" as a line of text.

    Edit

    Just to be completely transparent, because I did not have connect.php, I had to add my own DB connections. My whole page looked thusly:

    
    
    
    
    
     

    Find Customer's Albums Page

    From a dropdown list of customers, a user should be able to pick a customer and see a list of albums (all fields in the CD table) purchased by that customer.
    Customer:
    "; while($r = mysql_fetch_array($result)) { echo ""; } echo ""; ?>

提交回复
热议问题