Chinaunix

标题: [smarty]我的smarty怎么老是这个错误,大家帮我看看呀 [打印本页]

作者: chfeizy    时间: 2005-09-15 16:12
标题: [smarty]我的smarty怎么老是这个错误,大家帮我看看呀
<?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}

问题已经解决了 可以显示成功了
作者: 笨狗    时间: 2005-09-15 16:39
标题: [smarty]我的smarty怎么老是这个错误,大家帮我看看呀

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

???
作者: HonestQiao    时间: 2005-09-15 17:22
标题: [smarty]我的smarty怎么老是这个错误,大家帮我看看呀
那个是第18行?
作者: hightman    时间: 2005-09-15 19:21
标题: [smarty]我的smarty怎么老是这个错误,大家帮我看看呀

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

看错误信息应该是指这个?? 这个 $leaveword 有点莫明其妙, 笔误也不该误成这样吧
作者: HonestQiao    时间: 2005-09-15 19:32
标题: [smarty]我的smarty怎么老是这个错误,大家帮我看看呀
$leaveword是怎么来的?
没有看到什么地方定义了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2