该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
模板引擎中 foreach嵌套循环 内层只遍历一次的 求大神解决
html文件中的:
{foreach ($big as $key => $values)}
{/foreach}
php文件中的:
include 'tpl_func.php';
include 'common.php';
//var_dump($_SESSION['usertype']);
$big = sql_select($link,'bbs_category','*','parentid = 0;');
foreach ($big as $key => $values ){
$cid = $values['cid'];
$title = sql_select($link,'bbs_category','*',"parentid = $cid");
var_dump($title);
}
$time = date('m-d h:i',time());
$data = compact('big','time','title','cid');
var_dump($data);
display('index.html', $data);
?>