I have asked more questions. could you help me. Questions about SMARTY display category

Source: Internet
Author: User
I have asked a question again. could you help me. About the SMARTY display category, I made a classification. there are top-level classification and second-level classification $ questionfl $ page-& gt; pagesql (select & nbsp; * & nbsp; from & nbsp; questionfl & nbsp; where & nbsp; s); find the top-level Category $ q0; while ($ flrow) I am going to ask questions again. could you help me. Question about SMARTY display classification
I made a classification, including top-level classification and secondary classification.
$ Questionfl = $ page-> pagesql ("select * from questionfl where sid = false"); // you can specify a top-level category.
$ Q = 0;
While ($ flrows = $ questionfl-> fetchRow ()){
$ Listfl [$ q] ["id"] = $ flrows ["id"];
$ Listfl [$ q] ["name"] = $ flrows ["name"];

$ Questionsl = $ page-> pagesql ("select * from questionfl where sid = '". $ listfl [$ q] ["id"]. "'"); // level 2 classification
$ S = 0;
While ($ slrows = $ questionsl-> fetchRow ()){
$ Listsl [$ s] ["id"] = $ slrows ["id"];
$ Listsl [$ s] ["name"] = $ slrows ["name"];
$ Listsl [$ s] ["sid"] = $ slrows ["sid"];
$ S ++;
}
$ Q ++;
}


Html smarty calls can only display the last level-2 category in the top-level category. Seek help
{section name=listfl loop=$listfl}

{$listfl[listfl].name}


{section name=listsl loop=$listsl}
{$listsl[listsl].name}|
{/section}


{/section}

Php smarty classification display


------ Solution --------------------

{Foreach item = listfl from = $ listfl}

{$ Listfl. name}


{Foreach item = sub from = $ listfl. sub}
{$ Sub. name}
------ Solution --------------------

{/Foreach}


{/Foreach}

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.