SQL语句问题请高手解答?懂的来! 30
sub事件如下subarticle_left_hot(n_num,c_num)dimrs,sql,ltemp,topic,n_jtn_jt=img_skins()ltem...
sub事件如下
sub article_left_hot(n_num,c_num)
dim rs,sql,ltemp,topic,n_jt
n_jt=img_skins()
ltemp=vbcrlf&"<table cellSpacing=0 cellPadding=0 border=0 width='100%'>"
sql="select top "&n_num&" id,username,topic,tim,counter from news where c_id='20' hidden=1 order by counter desc,id desc"
set rs=conn.execute(sql)
do while not rs.eof
topic=rs("topic")
ltemp=ltemp&vbcrlf&"<tr><td height=20>"&n_jt&"<a href='javascript:;' onclick=""javascript:open_view('news_view.asp?id="&rs("id")&"');"" title='文章标题:"&objv7.code_html(topic,1,0)&"<br>发 布 人:"&rs("username")&"<br>整理时间:"&rs("tim")&"'>"&objv7.code_html(topic,1,c_num)&"</a></td></tr>"
rs.movenext
loop
rs.close:set rs=nothing
ltemp=ltemp&vbcrlf&"</table>"
response.write kong&main_bar(0,"<A href='news_list.asp?c_id=20'>大势导航 TOP 10</A>",ltemp,0,"100%","")
'ltemp=format_bar("<font class="&sk_class&">大势导航 TOP 10</font>",ltemp,"",sk_bar,"")
'response.write kong&format_bar3(ltemp)
end sub
原始是
sql="select top "&n_num&" id,username,topic,tim,counter from news where hidden=1 order by counter desc,id desc"
更改过的
sql="select top "&n_num&" id,username,topic,tim,counter from news where c_id='20' hidden=1 order by counter desc,id desc"
改过的就不能用了,郁闷,是提取表NEWS,里符合c_id='20' 的字段,哎,尽然报错,NEWS表是个新闻表,我重要提取小分类里面的吧,请问哪里有错误或写发有问题直接给出答案谢谢!! 展开
sub article_left_hot(n_num,c_num)
dim rs,sql,ltemp,topic,n_jt
n_jt=img_skins()
ltemp=vbcrlf&"<table cellSpacing=0 cellPadding=0 border=0 width='100%'>"
sql="select top "&n_num&" id,username,topic,tim,counter from news where c_id='20' hidden=1 order by counter desc,id desc"
set rs=conn.execute(sql)
do while not rs.eof
topic=rs("topic")
ltemp=ltemp&vbcrlf&"<tr><td height=20>"&n_jt&"<a href='javascript:;' onclick=""javascript:open_view('news_view.asp?id="&rs("id")&"');"" title='文章标题:"&objv7.code_html(topic,1,0)&"<br>发 布 人:"&rs("username")&"<br>整理时间:"&rs("tim")&"'>"&objv7.code_html(topic,1,c_num)&"</a></td></tr>"
rs.movenext
loop
rs.close:set rs=nothing
ltemp=ltemp&vbcrlf&"</table>"
response.write kong&main_bar(0,"<A href='news_list.asp?c_id=20'>大势导航 TOP 10</A>",ltemp,0,"100%","")
'ltemp=format_bar("<font class="&sk_class&">大势导航 TOP 10</font>",ltemp,"",sk_bar,"")
'response.write kong&format_bar3(ltemp)
end sub
原始是
sql="select top "&n_num&" id,username,topic,tim,counter from news where hidden=1 order by counter desc,id desc"
更改过的
sql="select top "&n_num&" id,username,topic,tim,counter from news where c_id='20' hidden=1 order by counter desc,id desc"
改过的就不能用了,郁闷,是提取表NEWS,里符合c_id='20' 的字段,哎,尽然报错,NEWS表是个新闻表,我重要提取小分类里面的吧,请问哪里有错误或写发有问题直接给出答案谢谢!! 展开
3个回答
展开全部
sql="select top "&n_num&" id,username,topic,tim,counter from news where c_id='20' and hidden=1 order by counter desc,id desc"
加and
加and
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sql="select top "&n_num&" id,username,topic,tim,counter from news where c_id=20 and hidden=1 order by counter desc,id desc"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询