View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Complex search with DB Search component of DA

Thread began 5/26/2009 1:09 pm by msummers194171 | Last modified 5/28/2009 9:44 am by msummers194171 | 1037 views | 5 replies

msummers194171

Complex search with DB Search component of DA

I want to be able to do a keyword search across multiple fields. For example, I want the client to be able to search for -

red widgets

in fields A, B, and C.

I have a form with a single text field called 'keywords'. If I add more than one item to that field ('red widgets'), I get a query like this -

SELECT * FROM items WHERE (((item_primary LIKE '%red%') OR (item_secondary LIKE '%red%') OR (item_content LIKE '%red%')) OR ((item_primary LIKE '%widgets%') OR (item_secondary LIKE '%widgets%') OR (item_content LIKE '%widgets%'))) ORDER BY item_id ASC

And what I really want is a query like this -

SELECT * FROM items WHERE (((LOWER(item_primary) LIKE LOWER('%red%')) OR (LOWER(item_secondary) LIKE LOWER('%red%')) OR (item_content LIKE '%red%')) AND ((item_primary LIKE '%widgets%') OR (item_secondary LIKE '%widgets%') OR (item_content LIKE '%widgets%'))) ORDER BY item_id ASC

(I didn't propagate the LOWER() usages for simplicity)

How can I get that?

Thanks,

Murray

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...