|
BeTheBall -> RE: keyword search (4/6/2005 17:08:09)
|
This is perhaps the most creative thing I have ever tried, but in theory it works. Try this: Assuming this is the last code you tried: Position = replace(replace(request.form("position"),"'","''")," ","%") If Position &""="" then Position = "%" sQry = "SELECT * FROM Results WHERE ([position] LIKE '%"&position&"%')" fp_sQry = sQry Replace the above with: <% varString = trim(replace(request.form("position"), "'","''")) arrString = Split(varString, " ") mySQL = "SELECT * FROM Results WHERE [position] LIKE '%"&arrString(0)&"%' " If Ubound(arrString)> 0 Then For i = 1 to Ubound(arrString) mySQL = mySQL & " AND fldname LIKE '%"&arrString(i)&"%' " Next End If fp_sQry = mySQL
|
|
|
|