日期:2014-05-17 浏览次数:20421 次
$questionfl=$page->pagesql("select * from questionfl where sid=false");//查找顶级分类
$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"]."'");//二级分类
$s=0;
while($slrows=$questionsl->fetchRow()){
$listsl[$s]["id"]=$slrows["id"];
$listsl[$s]["name"]=$slrows["name"];
$listsl[$s]["sid"]=$slrows["sid"];
$s++;
}
$q++;
}
{section name=listfl loop=$listfl}
<dl class="qa_sort">
<dt><a href="#">{$listfl[listfl].name}</a></dt>
<dd>
{section name=listsl loop=$listsl}
<a href="#">{$listsl[listsl].name}</a>|
{/section}
</dd>
</dl>
{/section}
{foreach item=listfl from=$listfl}
<dl class="qa_sort">
<dt><a href="#">{$listfl.name}</a></dt>
<dd>
{foreach item=sub from=$listfl.sub}
<a href="#">{$sub.name}</a>
------解决方案--------------------
{/foreach}
</dd>
</dl>
{/foreach}