Thinkphp implements the method of saving the values of columns in the database to the drop-down box. The thinkphp drop-down box
1. Check the value in the database and query the entire data table. The result is a two-dimensional array.
$ Project = M ("project"); $ cell = $ project-> where (array ('status' => 1)-> order ("id desc ") -> select (); // var_dump ($ cell); $ this-> assign ('cell ', $ cell );
2. Retrieve traversal at the foreground
<Select class = "test" style = "width: 88%; height: 35px; border-style: none; color: #767676; "id =" projectno "name =" projectno "> <option> & nbsp enter your residential area </option> <volist name =" cell "id =" vo "> <option value = "{$ vo ['id']}" >{$ vo ['name'] }</option> </volist> </select>
The above is all the content of this article. I hope this article will help you in your study or work. I also hope to provide more support to the customer's home!