Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search database with form help (DRW)

Status
Not open for further replies.

richiwatts

Technical User
Jun 21, 2002
180
GB
I have a form to search my database but I think the code completly wrong. I would be most grateful if someone can guide me in the right direction here.

I have 4 search entries to quiry the database and they are: (language from), (language to), (area) and (Name).

What I want them to search in the database is as follows:

language from = search in database under fields (languagefrom1,languagefrom2,languagefrom3) for a match.

language to = search in database under fields (languageto1,languageto2) for a match.

area = search in database under fields (area1, area2 through to area8) for a match.

name = Search under name field

The code that i have now is:

fp_sQry="SELECT * FROM Results WHERE (Translatefrom1 LIKE '%::Translatefrom1::%' OR Translatefrom2 LIKE '%::Translatefrom2::%' OR Translatefrom3 LIKE '%::Translatefrom3::%' AND Translateto1 LIKE '%::Translateto1::%' OR Translateto2 LIKE '%::Translateto2::%' AND Area1 LIKE '%::Area1::%' OR Area2 LIKE '%::Area2::%' OR Area3 LIKE '%::Area3::%' OR Area4 LIKE '%::Area4::%' OR Area5 LIKE '%::Area5::%' OR Area6 LIKE '%::Area6::%' OR Area7 LIKE '%::Area7::%' OR Area8 LIKE '%::Area8::%' AND Name LIKE '%::Name::%')"
fp_sDefault="Translatefrom=NULL&Translateto=NULL&Area=NULL&Name=NULL"

And the code for the form is:

<td><input TYPE=&quot;TEXT&quot; NAME=&quot;Translatefrom&quot; VALUE=&quot;<%=Request(&quot;Translatefrom1&quot;)%>&quot; size=&quot;20&quot;></td>
<tr>
<td><input TYPE=&quot;TEXT&quot; NAME=&quot;Translateto&quot; VALUE=&quot;<%=Request(&quot;Translateto1&quot;)%>&quot; size=&quot;20&quot;></td>
</tr>
<tr>
<td><input TYPE=&quot;TEXT&quot; NAME=&quot;Area&quot; VALUE=&quot;<%=Request(&quot;Area1&quot;)%>&quot; size=&quot;20&quot;></td>
</tr>
<tr>
<td><input TYPE=&quot;TEXT&quot; NAME=&quot;Name&quot; VALUE=&quot;<%=Request(&quot;Name&quot;)%>&quot; size=&quot;20&quot;></td>

Thanks you in advance for any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top