showphoto.asp?username=姓名,调用的问题
关于ASP的问题
调用
showphoto.asp?id=17
这样显示
sql="select photo from personinf where id=" & trim(request("id"))
改为
sql="select photo from personinf where username='" & trim(request("username"))&"'"
调用
showphoto.asp?username=姓名
这样不显示了
id和username都在一个表单里 17是姓名对应的ID photo 输出的图片是二进制
问题补充:<!--#include file="asp/opendb.asp"-->
<%
set conn=opendb("oabusy","conn","accessdsn")
Set rs=Server.CreateObject("ADODB.recordset")
sql="select photo from personinf where username like '" & trim(request.QueryString("username"))&"'"
rs.open sql,conn,1,1
Response.ContentType = "image/*"
Response.BinaryWrite rs("photo").getChunk(7500000)
%>
这个是showphoto.asp页面的代码
<%
set conn=opendb("oabusy","conn","accessdsn")
Set rs=Server.CreateObject("ADODB.recordset")
sql="select photo from personinf where username like '" & trim(request.QueryString("username"))&"'"
rs.open sql,conn,1,1
Response.ContentType = "image/*"
Response.BinaryWrite rs("photo").getChunk(7500000)
%>
这个是showphoto.asp页面的代码