<object runat=server id=connpic progid="adodb.connection"></object>
<%application.Lock
connpic.Open Application("p_pic")
Application.UnLock
%>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Supports ( adUpdate )
sql="select * from pic where user_name='"&request("user_name")&"'"
rs.open sql,connpic,2,3
if rs.RecordCount<>0 then
 while not rs.EOF
	rs("selected")=0
	rs.Update
	rs.movenext
	
wend
	
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from pic where id=" &request("id")
rs.open sql,connpic,2,3
if rs.RecordCount<>0 then
	rs("selected")=1
	rs.Update
end if

response.redirect "my_photo.asp"

%>