How to dynamically read database field content from the data in the drop-down list

Source: Internet
Author: User
How does the data in the drop-down list dynamically read the content of database fields? Select & nbsp; name = "cp_kh" & nbsp; id = "selModule" & gt; & nbsp; & lt; option & nbsp; value = "{$ row [$ I]}" & gt; & lt; /option & gt 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,
PHP database
------ Solution --------------------

Vehicle type

$ SQL = "select * from cartype ";
$ Query = mysql_query ($ SQL );
While ($ result = mysql_fetch_array ($ query )){
?>
">
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.