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 "<a href='xxx.php?id=<?=$nextid?>'>下一主题</a>";
}
}
function showpre(){
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))
$preid=row["id"];
echo "<a href='xxx.php?id=<?=$preid>'>上一主题</a>";
}
}
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";
}
| 共分1页 [1] |
关于网站 | 客服中心 | 服务条款 | 友情链接 | 广告联系 | 本站历程 | 网站导航
吉ICP备05000107号