高手进smarty问题全部家当了 赋值错误:$tpl->assign("newnotice",$array2);应该为$tpl->assign("oldnotice",$array2); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php require "smarty/main.php"; include "smarty/class/include/conn.php"; //咱家公告当前活动 mysql_query("SET NAMES 'gbk'"); $result1 = mysql_query("SELECT * FROM cdb_threads WHERE fid = '48' order by dateline desc limit 0,5"); while($row1=mysql_fetch_array($result1)){ $array1[] = $row1; } //咱家公告已往活动 $result2 = mysql_query("SELECT * FROM cdb_threads WHERE fid = '48' order by dateline desc limit 5,5"); while($row2=mysql_fetch_array($result2)){ $array2[] = $row2; } $tpl->assign("newnotice",$array1); $tpl->display('index.html'); $tpl->assign("oldewnotice",$array2); $tpl->display('index.html');?> 显示第二个查询<{section name=loop_1 loop=$oldnotice}> <tr> <td height="24" class="title_list"><{$oldnotice[loop_1].subject}></td> </tr><{/section}>第二个改下名字试试, error_reporting一下,看提示什么错误 $tpl->assign("newnotice",$array1);$tpl->display('index.html');$tpl->assign("oldewnotice",$array2);$tpl->display('index.html');一个页面只要一个display就行了$tpl->assign("newnotice",$array1);$tpl->assign("oldewnotice",$array2);$tpl->display('index.html'); 字符串处理成数组 关于使用ssh2_exec修改user密码的问题 如何在XML里面比较一个值 php导航分类代码求助 php怎么判断传递过来的值? PHP中字符串替换函数的问题。特别奇怪~@-@~! 关于PHP类调用类的问题 新手请教PHP怎么批量获取POST值并存入数据库! PHP中当前页面值的传递 收发发附件? 高人好心人来帮我解决个问题吧 如何取出 字段值??
require "smarty/main.php";
include "smarty/class/include/conn.php";
//咱家公告当前活动
mysql_query("SET NAMES 'gbk'");
$result1 = mysql_query("SELECT * FROM cdb_threads WHERE fid = '48' order by dateline desc limit 0,5");
while($row1=mysql_fetch_array($result1)){
$array1[] = $row1;
}
//咱家公告已往活动
$result2 = mysql_query("SELECT * FROM cdb_threads WHERE fid = '48' order by dateline desc limit 5,5");
while($row2=mysql_fetch_array($result2)){
$array2[] = $row2;
}
$tpl->assign("newnotice",$array1);
$tpl->display('index.html');
$tpl->assign("oldewnotice",$array2);
$tpl->display('index.html');
?>
<{section name=loop_1 loop=$oldnotice}>
<tr>
<td height="24" class="title_list"><{$oldnotice[loop_1].subject}></td>
</tr>
<{/section}>第二个改下名字试试,
$tpl->display('index.html');
$tpl->assign("oldewnotice",$array2);
$tpl->display('index.html');一个页面只要一个display就行了$tpl->assign("newnotice",$array1);
$tpl->assign("oldewnotice",$array2);$tpl->display('index.html');