How does the data in the drop-down list dynamically read the content of database fields? Select name = "cp_kh" id = "selModule">
When you click the drop-down list, the data in the drop-down list is dynamically retrieved from the database. How can I get the data of all rows under a field from the database table to the drop-down list. The drop-down list is arranged by a row of read data. Php reads data table fields and assigns values to the read data drop-down list. (How to implement it ?) For example,
Reply to discussion (solution)
I don't know what it means, and I didn't see a picture.
For example, the data in the 'customer name' field column is queried, such as customer A, Customer B, customer C, and customer D ..., assign the values of the data below this column to the drop-down list. you can select a customer to display a row.
When you click the drop-down list, the data in the drop-down list is dynamically retrieved from the database.
This is a poor user experience and will not be adopted.
The data in the list should be preset.
If the list is assigned by another control, you can use ajax
$ Result = mysql_query ("select customer name as name from table"); echo''; While ($ row = mysql_fetch_assoc ($ result) {echo"";} Echo'';
The drop-down list must contain the database, and the preset content cannot meet this requirement.
For example, the customer adds dynamic updates to the database, but it is not necessarily dead. When adding a product, you must select the target customer. Therefore, the product must be dynamic.
Vehicle type
The above code is perfect. Thank you very much.