I would loop over the "form.keywords" list and generate an SQL statement
for each.

<cfloop index="keyword" list="#form.keywords#">
AND keywords LIKE '%#keyword#%'
</cfloop>

Or something like that..

Darryl

-----Original Message-----
From: Seona Bellamy [mailto:[EMAIL PROTECTED] 
Posted At: Thursday, 18 September 2003 10:36 AM
Posted To: CFAussie
Conversation: [cfaussie] Dumb SQL problem
Subject: [cfaussie] Dumb SQL problem


Hi guys,

I'm sure that this is really easy, but I can't seem to figure it out.

I have a database column which takes one or more keywords that users can
use to filter the records. When there's more than one keyword they are
separated by commas, but for some records there is only one.

I then have a form field where users can enter the keywords they want to
filter by, separating them with commas. They may only put one keyword,
however (i.e., no commas).

What I need to do is to compare the two lists and return any records
where at least one of the keywords matches at least one of the keywords
passed by the form. I can't seem to find a way of doing this that works
under all sets of circumstances.

Any ideas anyone?

Cheers,

Seona.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003


---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED] To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to