文章上一篇 下一篇 功能
2012-12-29 13:22
337 查看
<?php header('Content-Type: text/html; charset=utf-8'); mysql_connect('localhost','root','123456') or die(mysql_error()); mysql_select_db('cc'); mysql_query("set names 'utf8'"); $id =$_GET['id'];//是你当前文章的编 $sql ="select * from string_find where id>$id order by id asc limit 0,1"; //上一篇文章 $sql1 ="select * from string_find where id<$id order by id desc limit 0,1"; //下一篇文 $result = mysql_query($sql); if( mysql_num_rows( $result )) { $rs = mysql_fetch_array( $result ); echo "<a href='f.php?id=".$rs[0]."'>下一篇</a>".$rs[0]; } else { echo "没有了"; } $result1 = mysql_query( $sql1); if( mysql_num_rows($result1)) { $rs1 = mysql_fetch_array( $result1 ); echo "<a href='f.php?id=".$rs1[0]."'>上一篇</a>".$rs1[0]; } else { echo "没有了"; } ?>
相关文章推荐
- 文章上一篇 下一篇 功能
- 感觉博客园的编辑期做的很烂,一篇文章快些完的时候,因为切换了一下网页,就没了,希望博客园的学学网易写电子邮件的时时保存功能。
- 发布一个文章读取模块,有前一篇和后一篇文章的功能,存储过程我直接贴上来了,大家自己改吧!
- 用Java 实现文章内容上一篇下一篇功能
- 转载一篇检查更新功能的文章
- ShopEx文章页添加上一篇下一篇功能
- 之前一篇文章的功能增加,新增了时间显示
- 集成Android免费语音合成功能(在线、离线、离在线融合),有这一篇文章就够了(在线)
- Asp.NET 中写存储过程执,实现上一篇,下一篇文章功能
- 集成Android免费语音合成功能(在线、离线、离在线融合),有这一篇文章就够了(离在线融合)
- 一篇文章解读提速、降费黑科技:PCDN定义、功能、架构、场景和优势
- 集成Android免费语音合成功能(在线、离线、离在线融合),有这一篇文章就够了(离线)
- 转一篇关于手机的文章(原题:极少人知道的手机隐藏功能)
- 一篇写给只会用svn update和commit功能的童鞋看的SVN文章
- 涉及很多技术 很多业务功能的一篇文章
- ShopEx文章页增加上一篇下一篇功能
- 字符串匹配的Boyer-Moore算法 作者: 阮一峰 日期: 2013年5月 3日 上一篇文章,我介绍了KMP算法。 但是,它并不是效率最高的算法,实际采用并不多。各种文本编辑器的"查找"功能(Ct
- 一篇详细介绍Hadoop系统组成部分及其功能的文章
- Thinkphp 3.2中文章详情页的上一篇 下一篇文章功能
- 一篇文章解读提速、降费黑科技:PCDN定义、功能、架构、场景和优势