Answered
keyword searching - displaying only the matched field
Hi,
I need some help writing a <Cfoutput> which displays only the fieldname which matched a search.
FYI, For example I have a form with a keyword field allows a user to do a "search by last name" that searches my very basic table which has multiple type of last names (ex. director_lastname, actor_lastname, etc.)
<cfquery name="Results" datasource="my_dsn">
SELECT * FROM my table WHERE
director_lastname LIKE '%#keyword#%' OR actor_lastname LIKE '%#keyword#%'
</cfquery>
Currently I can only figure out how to cfoutput the entire row that matched the querey
As always, Any help is greatly appreciated!
Thanks!
I need some help writing a <Cfoutput> which displays only the fieldname which matched a search.
FYI, For example I have a form with a keyword field allows a user to do a "search by last name" that searches my very basic table which has multiple type of last names (ex. director_lastname, actor_lastname, etc.)
<cfquery name="Results" datasource="my_dsn">
SELECT * FROM my table WHERE
director_lastname LIKE '%#keyword#%' OR actor_lastname LIKE '%#keyword#%'
</cfquery>
Currently I can only figure out how to cfoutput the entire row that matched the querey
As always, Any help is greatly appreciated!
Thanks!
