学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
发新话题
打印

新问题!

新问题!

<!--#include file="conn.asp"--> <!--#include file="fenye1.asp"--> <% bookn=request("bookn") leibie=request("leibie") 'response.write leibie outtime=request("outtime") chubanshe=request("chubanshe") if bookn="" then response.write("关键字不能为空") else session("a")=request("bookn") bookn=session("a") end if if leibie="所有" and outtime="所有" and chubanshe="所有" then sql="select * from allbook where bookname = '"&bookn&"' or bookname like '%bookn%' order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") '改为分页程序就可以了,建议用包含 end if elseif leibei<>"所有" and outtime="所有" and chubanshe="所有" then sql1="select * from allbook where leibie= '"&leibie&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql1,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei<>"所有" and outime<>"所有"and chubanshe="所有" then sql2="select * from allbook where leibie= '"&leibie&"' and outtime='"&outtime&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql2,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei<>"所有" and outime<>"所有"and chubanshe<>"所有" then sql3="select * from allbook where leibie= '"&leibie&"' and outtime='"&outtime&"' and chubanshe='"&chubanshe&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql3,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei="所有" and outime<>"所有"and chubanshe="所有" then sql4="select * from allbook where outtime='"&outtime&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql4,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei="所有" and outime<>"所有"and chubanshe<>"所有" then sql5="select * from allbook where outtime='"&outtime&"' and chubanshe='"&chubanshe&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql5,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if elseif leibei="所有" and outime="所有"and chubanshe<>"所有" then sql6="select * from allbook where chubanshe='"&chubanshe&"' and bookname = '"&bookn&"' or bookname like '%bookn%'order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql6,conn,1,1 if rs.recordcount=0 then closers response.write("对不起,没有你要找的记录!<br>") response.write "返回" else funye 'response.write("yes") end if end if %> <% sub closers rs.close set rs=nothing end sub%> 为什么我运行第二页就提示:关键字不能为空对不起,没有你要找的记录! 返回

TOP

没传参数吧?

TOP

你想到怎么传递参数吗?

if bookn="" then response.write("关键字不能为空") else session("a")=request("bookn") bookn=session("a") end if

http://www.59ita.cn

TOP

我没用过asp,

不过感觉好像是bookn传的有问题,你是从request里取的,为什么又把它存session里?

TOP

应该是这样

if bookn="" then 'response.write("关键字不能为空") bookn=session("a") else session("a")=request("bookn") end if

TOP

if bookn="" then 'response.write("关键字不能为空") bookn=session("a") else session("a")=request("bookn") end if

你没有写进session("a")怎么读出来!

[此贴子已经被作者于2004-06-20 19:02:38编辑过]

http://www.59ita.cn

TOP

if bookn="" then 'response.write("关键字不能为空") bookn=session("a") else session("a")=request("bookn") '这条就是写进,第一次从request里面读,然后写到session里,以后就直接从session里面读就行了。 end if

TOP

分页的话,页和页之间有个参数传递

http://www.68bar.com 版主位置空缺

TOP

用session最好!!!不过我觉得那个名字要取得特别些!不然有很多问题!!!特别是一个参数要传好几个页的!!
我是假的!我没脑筋,没有心肠,没有胆子,没有骨气,没剑,没钱,是个真真的大洞口.我身上空得连一块肉都没有... http://www.jqjsw.com 剧情介绍网......

TOP

以下是引用大光在2004-06-21 08:11:18的发言:

if bookn="" then 'response.write("关键字不能为空") bookn=session("a") else session("a")=request("bookn") '这条就是写进,第一次从request里面读,然后写到session里,以后就直接从session里面读就行了。end if

还是有问题,你不觉得吗?如果以开始就为空,会怎么样?我们还是讨论一下

http://www.59ita.cn

TOP

发新话题