28,391
社区成员
发帖
与我相关
我的任务
分享
SQL="Select *,IsNull(pic,'images_pic/t1.jpg') as pic2 from pro Where ID="&id
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open SQL,con,1,1
Response.Write "<img src='" & rs("pic2") & "' width=1004 height=262>"
<%
if Request("pic") <>"" then
response.write " <img src= "&rs('pic')&" width=1004 height=262>"
else
Response.Write " <img src='images_pic/t1.jpg' />"
end if
%>
<%
SQL="Select * from pro Where ID="&id
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open SQL,con,1,1
if Rs("pic") <>"" then '你写的request("pic"),如果是判断数据库里的是否为空,就改成rs("pic")
response.write " <img src='" & rs("pic") & "' width=1004 height=262>" '这里注意引号的用法。你写的明显有错误。
end if
if Rs("pic")="" then '同样这里要改成rs("pic")
Response.Write " <img src='images_pic/t1.jpg' />"
end if
%>
<%
SQL="Select * from pro Where ID="&id
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open SQL,con,1,1
if Not IsNull(Request("pic").Value) then
response.write " <img src=""" & rs("pic") & """ width=1004 height=262>"
Else
Response.Write " <img src='images_pic/t1.jpg' />"
end if
%>