解决方案 »

  1.   

    是的,你先在数据库中查询最新的4条信息,代码如下:$sql = "select * from tbname(表名) order by id desc limit 5";然后用do…while循环把内容生成出来就可以了。
      

  2.   

    不可以,因为文件后缀不是 php,不能被解析
    你可以用 js 实现
    <script src=重要事件.php></script>
    重要事件.php 中输出形如这样的 js 语句即可
    document.write('内容行');
    document.write('内容行');
    document.write('内容行');
    document.write('内容行');
    document.write('内容行');
      

  3.   

    非常感谢您的解答,我想在数据库中用news(content,id)的表来存放重要事件,那样id的排序应该是逆序的排才能表达出最近五项事件的意思吧?
      

  4.   

    感谢您的回答!您好,我给您看看我原来网页上显示重要事件的那一段代码
    <tr>
            <td height="115" valign="top" bgcolor="#D8D8BF"><p align="left">2014.10 &nbsp;  &nbsp;  &nbsp;&nbsp;&nbsp;&nbsp; <span class="STYLE11">&quot;<span class="STYLE11">A High-performance and High-programmability Reconfigurable Wireless Development</span> Platform&quot;(demo paper) is accepted by FPT 2014</span><br />
              2014.8 &nbsp;  &nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://cecaraw.pku.edu.cn/Eng_EPEE.html" target="_blank">EPEE Release</a><br />
              2014.6 &nbsp;  &nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="STYLE11">&quot;An Efficient and Flexible Host-FPGA PCIe Communication Library&quot; is accepted by FPL 2014<br />
            </span>2014.4 &nbsp;  &nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="STYLE14">&quot;GRT: a Reconfigurable SDR Platform with High Performance and Usability&quot; is accepted by HEART 2014</span></p>
              </td>
          </tr>
    您看如果用PHP+MySQL是不是要改成这样:
    <form action="displaynews.php" method>
    </form>
    然后再再去实现displaynews.php即可?
      

  5.   

    我好象数的很清楚了吧?
    你只要将<p></p> 之间的内容用 js 输出就可以了
    不需要表单