|
hessfirm -> RE: search with multiple values in one text field (4/8/2005 2:43:46)
|
the diet is working nicely. thanks! The code, though, to insert single quotes isn't...Here is the DRW code after the diet and new code you gave. I am sure I am missing something. The search form url is http://atlantanewhomesdirectory.com/TestPages/diettrialsearchform.htm The results page is http://atlantanewhomesdirectory.com/TestPages/diettrial.asp Also, if i am using multiple search form fields that query different fields in the table, how do i add them into this formula as well....For example, in the query below, i am searching using only 'builderbroker'...but what if i allow additional search form fields for different columns? And does is matter that we use SQl versus mySQL? <tbody> <!--#include file="../_fpclass/fpdblib.inc"--> <% if 0 then %> <SCRIPT Language="JavaScript"> document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>"); </SCRIPT> <% end if %> <% If trim(request.form("builderbroker"))&"" <> "" Then varString = trim(replace(request.form("builderbroker"), "'","''")) varString = Replace(varString, " ", ",") arrString = Split(varString, ",") mySQL = "SELECT * FROM Administration WHERE builderbrokerLIKE '%"&arrString(0)&"%' " If Ubound(arrString)> 0 Then For i = 1 to Ubound(arrString) mySQL = mySQL & " AND builderbrokerLIKE '%"&arrString(i)&"%' " Next End If Else mySQL = "SELECT * FROM administration" End If fp_sQry =mySQL fp_sDefault="" fp_sNoRecords="<tr><td colspan=2 align=left width=""100%"">No records returned.</td></tr>" fp_sDataConn="DedServer" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_iDisplayCols=2 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <!--#include file="../_fpclass/fpdbrgn1.inc"--> <tr> <td><%=FP_FieldVal(fp_rs,"ID")%></td> <td><%=FP_FieldVal(fp_rs,"Bookmark")%></td> </tr> <!--#include file="../_fpclass/fpdbrgn2.inc"--> </tbody>
|
|
|
|