Little brother I asked about the question again, you heroes help. About Smarty Display classification related issues

Source: Internet
Author: User
I came to ask questions again, you heroes to help. About Smarty Display classification issues
I make a classification, there are top categories, level two classification
$QUESTIONFL = $page->pagesql ("select * from QUESTIONFL where sid=false");//Find top-level categories
$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 Two classification
$s = 0;
while ($slrows = $questionsl->fetchrow ()) {
$LISTSL [$s] [id]]= $slrows ["id"];
$LISTSL [$s] ["name"]= $slrows ["name"];
$LISTSL [$s] [SID]]= $slrows ["Sid"];
$s + +;
}
$q + +;
}


The HTML Smarty call can only repeat the last level two classification in the top-level category. Ask the Warrior to be femdom
{section NAME=LISTFL loop= $LISTFL}

{$LISTFL [Listfl].name}


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


{/section}
PHP Smarty Category 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.