Populating dropdown - PHP Ajax MySQL

前端 未结 5 626
一整个雨季
一整个雨季 2020-12-10 23:21

I have 2 dropdowns on my HTML page : The first drop down contains the database column names based on which the the second dropdown would be populated i.e.

5条回答
  •  没有蜡笔的小新
    2020-12-11 00:01

    If you want a more dynamic solution (that will accommodate changes to the background DB) you can do something like this on your page:

    
    ...
    
    

    and then a script similar to:

    ";
    while($row=mysql_fetch_row($data)){
    echo "";
    }
    echo "";
    ?>
    

    I guess for real flexibility you'd also want to dynamically populate that first one using mysql_field_name in another script similar to above

提交回复
热议问题