我把代码贴一下,帮我改一下。
摸板:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>{/head/}</title>
</head><body><table width="90%" >
  <tr>
    <td><div align="center"><{$name}></div></td>
  </tr>
  <tr>
    <td><{$content}></td>
  </tr>
</table><p>&nbsp;</p>
</body>
</html>PHP代码://不知道应该怎么写里面的循环和摸板配合输出。
$query="select * from topic order by Tid DESC";
$result=@mysql_query($query) or die("wrong query:".mysql_error());
$Guest=@mysql_fetch_object($result);
echo $Guest->name."<br>".$Guest->content;

解决方案 »

  1.   

    html part:
            <!--{section name=property_list loop=$property_lists}-->
                <tr> 
                  <td width="9" rowspan="2" valign="top"><img src="../../images/leftline.gif" width="9" height="76"></td>
                  <td width="15" rowspan="2">&nbsp;</td>
                  <td width="106" rowspan="2" valign="middle"><a href="<!--{$property_lists[property_list].link}-->" target="_blank"><img src="<!--{$property_lists[property_list].image}-->" width="100" height="75" border="0"></a></td>
                  <td width="555"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Address:</strong> 
                    <!--{$property_lists[property_list].address}-->
                    </font></td>
                  <td width="41" height="24">&nbsp;</td>
                </tr>
                <tr> 
                  <td valign="top"><font size="2" face="Arial, Helvetica, sans-serif"> 
                    <!--{$property_lists[property_list].description|truncate:170}-->
                    <br>
                    </font><font size="1" face="Arial, Helvetica, sans-serif"><a href="<!--{$property_lists[property_list].link}-->" target="_blank">View 
                    Virtual Property Movie</a></font><font size="2" face="Arial, Helvetica, sans-serif">&nbsp; 
                    </font></td>
                  <td height="34" valign="top"><font size="2" face="Arial, Helvetica, sans-serif">&nbsp; 
                    </font></td>
                </tr>
              
                <tr> 
                  <td><img src="../../images/leftline.gif" width="9" height="19"></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
      <!--{/section}-->php part:
    $result = mysql_query($query);
    if(mysql_num_rows($result) != 0) {
    while($row = mysql_fetch_assoc($result)) {
    $property_lists[] = array('propertyid'=>$row['propertyid'], 'address'=>$row['address'], 'type'=>$row['propertytype'], 'rooms'=>$row['rooms'], 'floorarea'=>$row['floorarea'], 'description'=>$row['description'], 'image'=>"photo.php?photoname={$row['picfile1']}", 'askprice'=>(intval($row['askprice'])==0)?$row['askprice']:number_format($row['askprice']), 'link'=>"redirect.php?id={$row['propertyid']}");
    }
    } else{
    $property_lists = array();
    }
    $smarty -> assign("property_lists", $property_lists);