Since you are using the 'OR' condition, the keyword does not have to be in
the results for news.article (it can be in subtitle, title, keywords or
dated).  Try writing it his way....

<cfquery name="news" datasource="mydsn">
        select  news.title, news.subtitle, news.dated, news.id, news.article
        from            news
        where   news.complete = 1
        and             news.article like '#form.keywords#%'
--->    AND             news.subtitle like '#form.keywords#%'
        or              news.title like '#form.keywords#%'
        or              news.keywords like '#form.keywords#%'
        order by        news.dated desc
</cfquery>

Another possibility....  are you sure that your keyword appears in the
article field?  May sound like a stupid question.... but worth looking at.

Hope that I am not missing something in your question...

Chad


-----Original Message-----
From: Kay Smoljak [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 31, 2000 9:51 PM
To: CF-Talk
Subject: search query help


Hi all,

I have this simple search query that's perplexing me somewhat.

<cfquery name="news" datasource="mydsn">
        select  news.title, news.subtitle, news.dated, news.id, news.article
        from            news
        where   news.complete = 1
        and             news.article like '#form.keywords#%'
        or              news.subtitle like '#form.keywords#%'
        or              news.title like '#form.keywords#%'
        or              news.keywords like '#form.keywords#%'
        order by        news.dated desc
</cfquery>

I've tried it a million different ways (well almost :) ) - this seems
logical to me but it's not finding text that only appears in the
news.article field. What am I missing?

Regards,
K.
______________________________________________________
Kay Smoljak - HTML/ColdFusion Developer - PerthWeb Pty Ltd
Internet Solutions for your business!

Level 9/105 St George's Tc - Perth - Western Australia
Ph: (08) 9226 1366 Fax: (08) 9226 1375 Mobile : 0419 949 007
Visit Perth online! : www.perthweb.com.au

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to