Thinkphp multi-choice editing and selection

Source: Internet
Author: User
Tags php foreach
When creating a project, you must select multiple checkboxes. now it is basically a dynamic language. for example, after the selected technology is submitted, the database will be inserted (traversal and insertion), which is no problem, the problem is that we need to select multiple boxes during editing and the options submitted last time are selected. this is a bit difficult, because it is a two-long table and multiple data entries are inserted, finally, I got it done. the code is not very nice-looking action.

When creating a project, you must select multiple checkboxes. now it is basically a dynamic language. for example, after the selected technology is submitted, the database will be inserted (traversal and insertion), which is no problem, the problem is that we need to select multiple boxes during editing and the options submitted last time are selected. this is a bit difficult, because it is a two-long table and multiple data entries are inserted, finally, I got it done. the code does not look good at the action page:

 


$ Jis = $ jishu-> order ('px asc ')-> select (); // technical table, all technical categories

$ Xuanzhong = $ fp-> where ('anliid = "'. $ _ GET ['id']. '"')-> order ('Id asc ')-> select (); // The selected table

$ This-> assign ('zs', $ xuanzhong );

$ This-> assign ('jis ', $ jis); // assign a value for rendering.


View Code: foreach judgment written by volist of mixed editing and tp



{$ Vo. name} >
K]


Well, that's exactly what it looks like.

 

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.