ASP+SQL后台的待审产品信息提示内容是“对不起,没有您要查询的信息”怎么没有显示记录?

来源:百度知道 编辑:UC知道 时间:2024/05/03 18:49:19
<%
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
const MaxPerPage=8
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim rs
dim sql
search=request("search")
set rs=server.createobject("adodb.recordset")
sql="select id,gsid,cpmc from productshow where flag=0"
if search=1 then
sql=sql & " and cpmc like '%"&request("txtitle")&"%'"
else
sql=sql & " and cpgg like '%"&request(&

就是没有合适的记录可以被查询到。
检查数据库中是否有数据,如果有再检查给出的查询条件,如果给出的查询条件也符合,就检查程序。

汗啊,郁闷啊,太多太多的程序员都不注意sql注入," and cpmc like '%"&request("txtitle")&"%'",还有人每次在分页的时候使用那么长的分页判断,还有人会在页码上一条一条输出,就不会改编成两个子程序。