All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
.NET,vs,J2EE——面对SOA的荒谬与误解_.net资料_编程技术
实例学习PHP如何实现在线发邮件_php资料_编程技术
让Asp.NET的DataGrid可排序、可选择、可分页_[Asp.Net教程]
配置 SQL Server 2005 远程调试存储过程_[SQL Server教程]
如何无需编程便将数据SQL导出到MYSQL_[SQL,Server教程]
动态控件添加终极解决方案_[Asp.Net教程]
delphi CloseFile过程关闭文件
教你轻松掌握SQL Server的数据同步技术_[SQL Server教程]
delphi滚动条组件(TScrollBar)使用方法
GridView,中,DropDownList,弹出确认对话框_[Asp.Net教程]
Reading number is top 10 pictures
西游四格漫画(三)
小学生作文又现神作,你不得不佩服
2012 national geographic daily picture5
Absolutely shocked. National geographic 50 animal photographys9
网络游戏与脑残
XuYing poker perspective garment debut
Sora aoi on twitter1
Discharge accidentally Actresses by the breast2
Take you to walk into the most true north Korea rural1
避免防盗门的猫眼变成钥匙眼
Download software ranking
White deer villiage
Boxer's Top ten classic battle6
C#程序员参考手册
Take off clothes to survival
linux初级教程
jBuilder2006
Red cliff
The hero
Unix video tutorial9
Tram sex maniac 2 (H) rar bag19
归海一刀 published in(发表于) 2014/2/10 6:51:22 Edit(编辑)
下一主题的实现_[PHP教程]

下一主题的实现_[PHP教程]

上一主题/下一主题的实现_[PHP教程]


第一种方法:定义通用函数

function shownext(){
global thisid;
query="select * from TABLE_NAME where id>thisid order by id limit 1";
result=mysql_query(query);
if(result=0){
echo "已经是第一个主题了";
}else{
if(row=mysql_fetch_array(result))
nextid=row["id"];
echo "下一主题";
}
}
function showpre(){
global thisid;
query="select * from TABLE_NAME where idresult=mysql_query(query);
if(result=0){
echo "已经是最后一个主题了";
}else{
if(row=mysql_fetch_array(result))
preid=row["id"];
echo ">上一主题";
}
}




这里的 thisid 为当前主题的id


第二种方法:假设有一个主题链接为 (当前id为100)

detail.php?id=100&action=pre

或者

detail.php?id=100&action=next

然后在主题显示页面detail.php取记录时使用如下条件语句

switch(acttion) {
case
'next':
sql = "select * from table where id > id limit 0,1";
break;
case
'prev':
sql = "select * from table where id < id order by id desc limit 0,1";
break;
default:
sql = "select * from table where id = id";
}









添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.