Sorry for the pnats title, didnt know how to describe this problem i am facing.
I have this piece of code
which works fine, it pulls the top 5 from the db where there are matches in stock, what i have been asked is if there are only say 2 in stock is to make it up to 5 by pulling the remainder where there stock is 0.
any help, assistance or the right direction greatly appreciated on this one.
Smalls
I have this piece of code
Code:
x=1
cmd.commandtext="select top 5 * from tunes where artist='" & rs("artist") & "' and id <> " & tempid & " and not left(catno,2)='vs'and number_in_stock >0 "
set rs=cmd.execute
do while not rs.eof
if x=1 then response.write("<B>Just a selection of other items by '" & tartist & "'</b><BR><table width=100% cellspacing=0 cellpadding=3>")
response.write ("<tr><TD><li>" & rs("artist") & " - " & rs("title") & " - " & lookupformat(rs("format")) & "</td><Td width=10% ><a href=fulldetails.asp?id=" & rs("id") & "><img src=images/view.gif border=0></a> ")
if cint(rs("number_in_stock")) > 0 then
Response.Write "<a href=icart.asp?id=" & rs("catno") & "&function=addmini&price=" & rs("priceout") & " target=""newcart""><img src=images/buy.gif border=0></a>"
else
Response.Write "<a href=reserve.asp?id=" & rs("catno") & "&function=add&price=" & rs("priceout") & "&title=" & server.urlencode(rs("title")) & "&artist=" & server.urlencode(rs("artist")) & "&noinstock=" & server.urlencode(rs("number_in_stock")) & "&description=" & server.urlencode(rs("comments")) & "><img src=images/reserve.gif border=0></a>"
end if
response.write("</td></tr>" & vbcrlf)
rs.movenext
x=x+1
loop
if not x=1 then response.write("</table><br>")
which works fine, it pulls the top 5 from the db where there are matches in stock, what i have been asked is if there are only say 2 in stock is to make it up to 5 by pulling the remainder where there stock is 0.
any help, assistance or the right direction greatly appreciated on this one.
Smalls
