Forum Moderators: open
This is the start of the search results function. After this it pulls up some paged thumbnails, pretty standard stuff:
ElseIf pg = "search" Then
If mode = "" Then
Response.Write img1 & pc
ElseIf mode = "results" Then
If searchBy = "" Then searchBy = "Products"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.CursorLocation = adUseClient
sqlsrch = Replace(srch, "XX", "%%%' OR field LIKE '%%%")
If searchBy = "Products" Then sqlQry = "SELECT DISTINCTROW TOP "&maxRecords&" ITEMID, SKU, ITEMNAME, MANUFNAME, THUMBNAIL, DESCRIP FROM qInventoryByManuf WHERE SKU LIKE '%%%"&Replace(sqlsrch, "field", "SKU")&"%%%' OR ITEMNAME LIKE '%
Etc. etc.
I just want to insert a copy of the users entered search phrase into a seperate column in the DB.
Rem - record the phrase
sqlQry = "insert into foo(test) values(" & sqlsrch & ") "
Rem - search the db...
sqlQry = sqlQry & "SELECT DISTINCTROW TOP "&maxRecords&" ITEMID, SKU, ITEMNAME, MANUFNAME, THUMBNAIL, DESCRIP FROM qInventoryByManuf WHERE SKU LIKE '%%%"&Replace(sqlsrch, "field", "SKU")&"%%%' OR ITEMNAME LIKE '%