close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Tweaking search criteria - AND/OR etc

Thread began 12/04/2011 9:59 am by iainmacdonald331081 | Last modified 12/05/2011 1:11 pm by iainmacdonald331081 | 709 views | 4 replies

iainmacdonald331081

Tweaking search criteria - AND/OR etc

I've got a working search page here, for a driving schools database:

search/

But I'm not sure how to quite get the search as I would ideally like.

Basically there are a number of text fields, all using AND, which is fine.

There are also two checkboxes for schools with female instructors or intensive course.

So for example, I have added two schools with a name containing Handprint.

The way I have in my head it would work is that if you just search for Handprint, and leave both checkboxes unchecked, it should find both schools called Handprint.

i.e. WHERE school contains Handprint AND Female = Y OR N AND Intensive = Y OR N

But using AND, if they're left unchecked its only finding the Handprint without them checked.

WHERE School contains Handprint AND Female =N and Intensive =N

//comparison list additions
$WADbSearch1->addComparisonFromEdit("School","S_School","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("Owner","S_Owner","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("Area","S_Area","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("Town","S_Town","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("County","S_County","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("PostCode","S_PostCode","AND","Includes",0);
$WADbSearch1->addComparisonFromCheck("Female","S_Female","N","N","AND","<>","=",0);
$WADbSearch1->addComparisonFromCheck("Intensive","S_Intensive","N","N","AND","<>","=",0);



Alternatively, if I use OR for the checkboxes, the results return and school called Handprint, or with no female instructors or intensive courses.

WHERE School contains Handprint OR Female = N OR Intensive = N

//comparison list additions
$WADbSearch1->addComparisonFromEdit("School","S_School","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("Owner","S_Owner","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("Area","S_Area","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("Town","S_Town","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("County","S_County","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("PostCode","S_PostCode","AND","Includes",0);
$WADbSearch1->addComparisonFromCheck("Female","S_Female","N","N","OR","<>","=",0);
$WADbSearch1->addComparisonFromCheck("Intensive","S_Intensive","N","N","OR","<>","=",0);



Not sure if I've explained that very well, or if its even possible?

Thanks for any pointers or suggestions.

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...