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}