> cfqueryparam doesnt seem to be doing as expected:
>
> <cfquery name="contacts" datasource="Contacts" >
> SELECT ID, FirstName, LastName, JobTitle,BusinessPhone FROM
> exoduscontacts
> WHERE
> LastName like '%<cfqueryparam value="form.what">%' ORDER BY
> LastName ASC
> </cfquery>
That's clearly not going to work; that's not how prepared statements work
(which is what CFQUERYPARAM allows you to build). You won't use quotes with
CFQUERYPARAM values.
You might try placing the wildcards into your CFQUERYPARAM tag's value:
<cfset myval = "%" & Trim(Form.what) & "%">
<cfquery ...>
....
WHERE LastName LIKE <CFQUERYPARAM VALUE="#myval#"> ...
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists