PHP菜鸟求助:如何实现动态展示最新的5条事件? php数据库html 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是的,你先在数据库中查询最新的4条信息,代码如下:$sql = "select * from tbname(表名) order by id desc limit 5";然后用do…while循环把内容生成出来就可以了。 不可以,因为文件后缀不是 php,不能被解析你可以用 js 实现<script src=重要事件.php></script>重要事件.php 中输出形如这样的 js 语句即可document.write('内容行');document.write('内容行');document.write('内容行');document.write('内容行');document.write('内容行'); 非常感谢您的解答,我想在数据库中用news(content,id)的表来存放重要事件,那样id的排序应该是逆序的排才能表达出最近五项事件的意思吧? 感谢您的回答!您好,我给您看看我原来网页上显示重要事件的那一段代码<tr> <td height="115" valign="top" bgcolor="#D8D8BF"><p align="left">2014.10 <span class="STYLE11">"<span class="STYLE11">A High-performance and High-programmability Reconfigurable Wireless Development</span> Platform"(demo paper) is accepted by FPT 2014</span><br /> 2014.8 <a href="http://cecaraw.pku.edu.cn/Eng_EPEE.html" target="_blank">EPEE Release</a><br /> 2014.6 <span class="STYLE11">"An Efficient and Flexible Host-FPGA PCIe Communication Library" is accepted by FPL 2014<br /> </span>2014.4 <span class="STYLE14">"GRT: a Reconfigurable SDR Platform with High Performance and Usability" is accepted by HEART 2014</span></p> </td> </tr>您看如果用PHP+MySQL是不是要改成这样:<form action="displaynews.php" method></form>然后再再去实现displaynews.php即可? 我好象数的很清楚了吧?你只要将<p></p> 之间的内容用 js 输出就可以了不需要表单 求无限(穷)目录方法 请教session的问题!! gd生成图片问题 @mysql_pconnect mysql_pconnect区别 大家怎么处理tag 如何使用数据库实现php的session? 类里的function返回值问题 过滤word文件另存为的HTML文件中的冗余样式代码 一人多ID的数据库表的设计问题 PHP 关于网站被攻击,如何限制.php后面不能输入任何字符。 php中打印输出echo与嵌入html代码两种的比较 为什么百度搜索几具网站上显示自己的外网IP不一致?
你可以用 js 实现
<script src=重要事件.php></script>
重要事件.php 中输出形如这样的 js 语句即可
document.write('内容行');
document.write('内容行');
document.write('内容行');
document.write('内容行');
document.write('内容行');
<tr>
<td height="115" valign="top" bgcolor="#D8D8BF"><p align="left">2014.10 <span class="STYLE11">"<span class="STYLE11">A High-performance and High-programmability Reconfigurable Wireless Development</span> Platform"(demo paper) is accepted by FPT 2014</span><br />
2014.8 <a href="http://cecaraw.pku.edu.cn/Eng_EPEE.html" target="_blank">EPEE Release</a><br />
2014.6 <span class="STYLE11">"An Efficient and Flexible Host-FPGA PCIe Communication Library" is accepted by FPL 2014<br />
</span>2014.4 <span class="STYLE14">"GRT: a Reconfigurable SDR Platform with High Performance and Usability" is accepted by HEART 2014</span></p>
</td>
</tr>
您看如果用PHP+MySQL是不是要改成这样:
<form action="displaynews.php" method>
</form>
然后再再去实现displaynews.php即可?
你只要将<p></p> 之间的内容用 js 输出就可以了
不需要表单