免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1360 | 回复: 4
打印 上一主题 下一主题

[smarty]我的smarty怎么老是这个错误,大家帮我看看呀 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-09-15 16:12 |只看该作者 |倒序浏览
<?php
include("./inc/db_connect.php");
require "./smarty/libs/Smarty.class.php";
$query_news="select id,type,title,tm from news where type=1 order by istop desc,id desc limit 16";//读取文章列表
$res_news=mysql_query($query_news);
$list=array();
while($rs=mysql_fetch_array($res_news)){
$list[]=$rs;
}
      $smarty = new Smarty;  
      $smarty->;template_dir ="./smarty/templates/";
      $smarty->;compile_dir="./smarty/templates_c/";
          $smarty->;config_dir ="./smarty/configs/";
      $smarty->;cache_dir="./smarty/cache/";
      $smarty->;caching         = true;
      $smarty->;left_delimiter  = "{";
          $smarty->;right_delimiter = "}";
      $smarty->;assign("total",$list);
          $smarty->;display("example.tpl");
   ?>;
{section name=notes loop=$total}
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666">;
<tr bgcolor="#FFFFFF">;
<td width="14%">;{$total[notes].title}</td>;
<td width="36%">;{$total[notes].tm}</td>;
</tr>;
</table>;
{/section}

问题已经解决了 可以显示成功了

论坛徽章:
0
2 [报告]
发表于 2005-09-15 16:39 |只看该作者

[smarty]我的smarty怎么老是这个错误,大家帮我看看呀


  1. $list[]=$rs;
复制代码

???

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
3 [报告]
发表于 2005-09-15 17:22 |只看该作者

[smarty]我的smarty怎么老是这个错误,大家帮我看看呀

那个是第18行?

论坛徽章:
0
4 [报告]
发表于 2005-09-15 19:21 |只看该作者

[smarty]我的smarty怎么老是这个错误,大家帮我看看呀


  1.     $leaveword->;assign("total",$list);
复制代码

看错误信息应该是指这个?? 这个 $leaveword 有点莫明其妙, 笔误也不该误成这样吧

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
5 [报告]
发表于 2005-09-15 19:32 |只看该作者

[smarty]我的smarty怎么老是这个错误,大家帮我看看呀

$leaveword是怎么来的?
没有看到什么地方定义了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP