Hi,

I have a query that I need to use to search a text field in a table.  The text strings 
that are in the table in this field sometimes include a pound sign (#).  Whenever I 
the query is run using a variable that includes a pound sign it returns no records. 
Here is an abbreviated example of my code.

There are two templates.  The first is a form:

<cfform action="Search.cfm" method="Post">
<cfinput type="text" name="SearchString">
<input type="submit">
</cfform>

The second page:

<cfquery name="TheSearch" datasource="TheDatabase">
SELECT *
FROM    TheTable
WHERE  TheTextField = '#SearchString#'
</cfquery>

Do I need to encode the variable somehow?

Thanks,

Eric Homa



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to