Database searching

Results 1 to 2 of 2

Thread: Database searching

  1. #1
    Join Date
    Dec 1969

    Default Database searching

    I am trying to add a search facility to my website at What I have is various products with certain features and I am trying to search through the database and pick out the features that have been selected.<BR><BR>I would use a query string like ?feature1=true&feature2=false<BR><BR>and would use this information to query the database but I am unsure about how to do this.<BR><BR>The database is setup as<BR>Name [text]<BR>Feature1 [Yes/No]<BR>Feature2 [Yes/No]<BR><BR>Thanks for your help<BR>By the way: I am using a DSN-Less connection

  2. #2
    Join Date
    Dec 1969

    Default RE: Database searching

    What do you mean by "I am unsure about how to do this"?<BR><BR>Simply retrieve the value from your QueryString into variables then create your SQL Query no?<BR><BR>&#060;%<BR>Dim strValue1<BR>Dim strValue2<BR>. . .<BR>. .<BR>.<BR><BR>strValue1 = Request.QueryString("value1")<BR>strValue2 = Request.QueryString("value2")<BR>. . . <BR>. .<BR>.<BR><BR>&#039;Build the SQL Query<BR>Dim strSql<BR><BR>strSql = "SELECT * FROM Table WHERE Field1 = &#039;" & strValue1 & "&#039; AND Field2 = &#039;" & strValue2 & "&#039;"<BR><BR>&#039;FOR DEBUG ONLY<BR>&#039;Response.Write strSql & "&#060;hr&#062;"<BR>&#039;Response.End<BR><BR>&#03 9;Execute the query...<BR>%&#062;<BR><BR>You may also want to look into SQL Injection Attacks here...<BR><BR><BR><BR>Hope this helps!<BR>Sincerely<BR><BR>Vlince

Posting Permissions

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