想在首页上调用5张用户上传的图片,但是却不能每个ID用户上传一张图片显示,每次一个ID用户要是传多张图片就把别的上传图片挤没了,我想请教高手下列代码如何修改能只显示ID用户当前一张图片

希望在原代码的基础上添加改动代码

<table width="104" border="0" align="left" cellpadding="0" cellspacing="5">
              <tr> 
                <%set rs=server.createobject("adodb.recordset")
sql="select a.Username,a.Userbiradd,a.Userbirthday,b.Photourl,a.Userid,b.pid from Ms_User a inner join Ms_photo b on a.Username=b.username where a.Userphoto<>0 order by a.Userregdate desc"
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
ip=0
do while not rs.eof
        ip=ip+1%>
                <td width="94" height="115"> <table width="82" height="64" border="0" align="center" cellpadding="0" cellspacing="3" class="td">
                    <tr> 
                      <td width="81" align="center" valign="middle"> <div align="center"><a href="Viewpic.asp?pid=<%=rs("pid")%>" target="_blank"><img src=<%=rs("Photourl")%> width="79" height="97" border=0 align="absmiddle"></a></div></td>
                    </tr>
                  </table>
                  
                </td>
                <%if ip>=5 then exit do
            rs.movenext
            loop
            rs.close
            end if%>
              </tr>
            </table>