这是什么错误,虽然提示没定义索引,但没有显示是哪个未定义的索引?

Notice: Undefined index:  in C:\wamp\www\new09\system\compile\76c81b74e5c331134741df9f50203e43f8ab112b.file.new_list.tpl.php on line 78

视图代码:

{section name=arr loop=$rst2 max=10 start=0}
          
                 {if $smarty.section.arr.index<10 }
					<li><a href="new_con.php?&id={$rst2[arr].news_id}&ntr={$rst2[arr].news_type}" title="{$rst2[arr].news_title}">{$rst2[arr].news_title}</a></li>
		{/if} 
    {/section}

逻辑控制代码:

<?php
require_once('include.php');
 
$ntr=$_GET["ntr"];
if(isset($_GET['ntr']) && isset($_GET['page'])){
	$page=$_GET['page'];
	$ntr=$_GET['ntr'];

}else{
	$ntr="";
	$page=1;
}
$sql = $seppage->ShowData("select * from tb_news",$conn,10,$page);	

 $sql2="select * from tb_news where news_type={$ntr} order by news_date DESC";
 $rst2 = $admindb->ExecSQL($sql2,$conn);
	  
$smarty->assign("formarr",$sql);
$smarty->assign('showpage',$seppage->ShowPage($ntr,'',"a"));

$arrtype=array("","新闻动态","科研成果","工学结合","学生工作");
$smarty->assign('arrtype',$arrtype);	

$smarty->assign('ntr',$ntr);
$smarty->assign('rst2',$rst2);
$smarty->display('new_list.tpl');
//echo $arrtype[4];
?>


错过了年华
浏览 1759回答 1
1回答

天使之翼死神之镰

视图层 {if $smarty.section.arr.index<10 }应该有问题,先把if这段去掉试试看,还有你遍历为什么不用foreach,新手还是不要碰section

慕瓜9220888

AYRTJQNTUYSAGHUNTKUMKWOXUUASJFNSLOHBYPRKYSOKBJUZBJWMICMDDZUXHTTMTSRCVFYFXOQMHAXTAOJRQYBRNNXEQZVLNQUYYXCKRKDNCQBTBXAHQYPYRQATFPKRGRGJLUARINPNQTTOYCENIRLHMNYWLDOYRRPAMPRBKRKUSUKMMFCLLMHJBDZJTYPXXCFVSKIZRTLUNPOJHAKNUKLFKBTVQTOERSGTVUHKDMINPRQPMPPABQFANAGMDXMETWFCLNOWYNDCMVVMBUZGSLVZGYDVVOEEDYQPAX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