ASP调用数据库里所有的图片

来源:百度知道 编辑:UC知道 时间:2024/06/05 20:31:53
<%
sql="select * from info where and pic<> order by desc"

Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if request("page")="" then
page=1
else
page=clng(request("page"))
end if
m=0
dim t
rs.pagesize=8
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
if rs.pagecount>0 then rs.absolutepage=page
DO WHILE NOT RS.EOF and m<rs.pagesize
%>

看看哪里有问题

sql="select * from info where pic<>'' order by id desc"
改成这样才正确

sql="select * from info where and pic<> order by desc" order by这里应该有个字段名 pic<>后面加上''

pic<>你的本意是不等于空是吧?
空是一个字符串,要表示就要用引号啊而SQL语句外面有一个双引号所以你应该写成pic <> ''才行的