check...please help!!

Results 1 to 2 of 2

Thread: check...please help!!

  1. #1
    jacod Guest

    Default check...please help!!

    Hi,<BR><BR>I am trying to show certain data based on it availability however am unsure of how to go about doing so. The code below checks against the database and then populates the dropdown box with values.<BR><BR>****<BR>code<BR>****<BR>sql="Select * from books where bid = " &Request.QueryString("bid") &" and lid = " &Request.QueryString("lid") <BR> sql, conn, 2, 2<BR><BR>How can I write so that if the books are less than for example 10 it will not populate the dropdown box and redirect the user back to the main page.<BR><BR>many thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: check...please help!!

    Something like this, Change BOOK_ID_FIELD to your unique id field in the book table:<BR><BR>&#060;%<BR>sql = "SELECT Count(BOOK_ID_FIELD) as BookCount where bid = " &Request.QueryString("bid") &" and lid = " &Request.QueryString("lid") <BR> sql, conn, 2, 2<BR>If rs("BookCount").value&#060;10 Then<BR> Response.redirect "Main.asp"<BR>Else<BR> &#039; ....<BR> &#039;YOUR CODE<BR>End If<BR>%&#062;<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts