然然
新手上路

UID 119122
精华
0
积分 12
帖子 8
金钱 12 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2008-4-17
状态 离线
|
[广告]: q
m
新手求教数据库ID问题
$sql="select * from $table_a order by id desc ";
//以下查询表中其他内容,在此省略。
$sql2="select * from $table_a where id=$rows[id]-1 ";
//以下查询表中其他内容,在此省略。
$sql3="select * from $table_a where id=$rows2[id]-1 ";
//以下查询表中其他内容,在此省略。
$sql4="select * from $table_a where id=$rows3[id]-1 ";
//以下查询表中其他内容,在此省略,重复类似查询……
$sq110="select * from $table_a where id=$rows9[id]-1 ";
//现已按降序查询出10个ID
我现在把10个ID放在<table>的10个<td>里分别显示10个ID: rows[id], rows2[id], rows3[id]……rows10[id]
现在出现一个问题,比如某用户发了个贴,ID为50。发了后他把该贴删除,然后再重发一个贴,此时ID为51。
但现在正好没了ID为50的那个贴。我的SQL查询查完ID为51的就中断了,在<td>中的显示也中断了。
请教高手,如何解决该问题?
[ 本帖最后由 然然 于 2008-4-30 01:39 AM 编辑 ]
|
|