1.不知道该把这段代码放在php里还是html里
2.win8开发居然显示不兼容

解决方案 »

  1.   

    其实放在php和html都是可以的
    就是你代码里面的<?= $row['title']?>这样的短标签不支持 还是改成<?php echo $row['title'];?>吧
      

  2.   

    改成了这样,虽然没有错误但读取不到数据,数据库有记录条<html>
    <head><title></title></head><body><?php  
      include("conn.php");  
    ?>  
    <table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">  
    <?php     
      $sql = "SELECT * FROM message order by lastdate desc";  
      $query = mysql_query($sql);  
      while($row = mysql_fetch_array($query)){  
    ?>  
      
      <tr bgcolor="#eff3ff">  
      <td><b><big>  
        标题:<?php echo $row['title'];?></big><b/>     <b><sub>  
        用户:<?php echo $row['user'];?></sub></b></td>  
      </tr>  
      <tr bgColor="#ffffff">  
      <td>内容:<?= toHtmlcode($row['content'])?></td>  
      </tr>  
    <?php   
      }  
    ?>  
    </table>  
    </body>
      </html>
      

  3.   

    你的内容没改啊 并且你的toHtmlcode函数有吗?
      

  4.   

    <td>内容:<?= toHtmlcode($row['content'])?></td>  
      

  5.   

    你好,问题解决了吗?你的conn.php 贴出来看看?
      

  6.   

     while($row = mysql_fetch_array($query)){  
        print_r($row);
    }