Answered
Search form code help
I'm a total CF newbie. I need to do a simple "Keyword" search
of a small database.
The goal is the user enters one word all rows in the database are returned if the keyword appears in any field in the row. In theory I'd like to return the results in table format but first I just want it to work.
Here's my search form
<form action="results2.cfm" method="post" name="Search" id="Search">
<input name="keyword" type="text" id="keyword">
<input type="submit" name="Submit" value="GO">
</form>
Here's my query and output
<cfquery name="keysearch" datasource="ExhibitorWebDBase">
SELECT CompanyName, Email, WebSite, ExhibitorCategory
FROM ExhibitorWebDBase
WHERE CompanyName or Email or WebSite or ExhibitorCategory LIKE '%#form.keyword#%'
</cfquery>
<p class="auction1">Your Search Produced the Following Results</p>
<cfoutput query="keysearch">#keysearch.keyearch#<br></cfoutput>
This is the error message it's producing...
Element KEYEARCH is undefined in KEYSEARCH.
I feel like I am OK down to my WHERE statement (but maybe not)
Thanks you so much in advance for any help!
The goal is the user enters one word all rows in the database are returned if the keyword appears in any field in the row. In theory I'd like to return the results in table format but first I just want it to work.
Here's my search form
<form action="results2.cfm" method="post" name="Search" id="Search">
<input name="keyword" type="text" id="keyword">
<input type="submit" name="Submit" value="GO">
</form>
Here's my query and output
<cfquery name="keysearch" datasource="ExhibitorWebDBase">
SELECT CompanyName, Email, WebSite, ExhibitorCategory
FROM ExhibitorWebDBase
WHERE CompanyName or Email or WebSite or ExhibitorCategory LIKE '%#form.keyword#%'
</cfquery>
<p class="auction1">Your Search Produced the Following Results</p>
<cfoutput query="keysearch">#keysearch.keyearch#<br></cfoutput>
This is the error message it's producing...
Element KEYEARCH is undefined in KEYSEARCH.
I feel like I am OK down to my WHERE statement (but maybe not)
Thanks you so much in advance for any help!
