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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

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

Sign in to reply to this post

Jason ByrnesWebAssist

set the checked value of the checkboxes to "Y"

in the data assist search wizard, don't use the checkbox comparison type for those 2, use the edit comparison type.

this will cause the checkboxes to be ignored if not checked, and use Y as the comparison value if they are checked.

Sign in to reply to this post

iainmacdonald331081

Thanks Jason.

The form in the page above was done with the full WADA wizard.

Just tried using the search wizard, and not sure where I'm supposed to be selecting any comparison type though....

I've got the 'Select the search element to add' page, so assume I select 'Single Checkbox' plus AND or OR.

Then the Checkbox Search page, where I select the column (e.g. Female), Column type - just text? Checked value = Y, and unchecked value <> Y.

But nothing about checkbox or edit comparison type.

And the results page it created doesn't look like its doing anything - it hasn't created anything at all within the BODY tag.

Not sure what I'm not seeing here...

And similarly, in the main WADA wizard, I can only see where to select AND or OR, and how its displayed, eg a Checkbox, and the criteria, e.g. =, <>, contains, begins with etc

Sign in to reply to this post

Jason ByrnesWebAssist

I'm not talking about using the wizard to recreate the search. instead. on the results page, open the server behaviors panel (Window -> Server Behaviors). Double click the Data Assist Search server behavior to edit it.

select the criteria for the first check box and click the edit button. Change the Criteria Type from checkbox to edit.

Repeat for the second checkbox.

on the search page, select the checkboxes, in the property inspector, set the checked value to Y

Sign in to reply to this post

iainmacdonald331081

Thanks Jason - that all looks like its doing exactly what I want now.

Sign in to reply to this post

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