close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Search Criteria set to AND or OR user preference

Thread began 12/31/2009 12:45 am by jo4koalas392067 | Last modified 1/08/2010 4:29 pm by jo4koalas392067 | 1656 views | 7 replies

Eric Mittman

I took a look at the page and I think the problem may just be the placement of the if statements. Rather than trying to get the if statements in the correct location through trial and error it may be easier to just update the first DASearch server behavior that you have on the page. You can use a ternary expression to switch the 'OR' and 'AND' separators. In the page that you posted you could do this by changing lines 51-57 to be like this:

$WADbSearch1->addComparisonFromEdit("StateOccVisaID","S_StateOccVisaID",(isset($_POST['All']) && $_POST['All'] == 'Yes')?"OR":"AND","=",1);

  $WADbSearch1->addComparisonFromEdit("ASCO","S_SOVOccupationID",(isset($_POST['All']) && $_POST['All'] == 'Yes')?"OR":"AND","Begins With",0);
  $WADbSearch1->addComparisonFromEdit("SOVStateID","S_SOVStateID",(isset($_POST['All']) && $_POST['All'] == 'Yes')?"OR":"AND","=",1);
  $WADbSearch1->addComparisonFromCheck("V176","176","Yes","",(isset($_POST['All']) && $_POST['All'] == 'Yes')?"OR":"AND","=","=",0);
  $WADbSearch1->addComparisonFromCheck("V886","886","Yes","",(isset($_POST['All']) && $_POST['All'] == 'Yes')?"OR":"AND","=","=",0);
  $WADbSearch1->addComparisonFromCheck("V475","475","Yes","",(isset($_POST['All']) && $_POST['All'] == 'Yes')?"OR":"AND","=","=",0);
  $WADbSearch1->addComparisonFromCheck("V487","487","Yes","",(isset($_POST['All']) && $_POST['All'] == 'Yes')?"OR":"AND","=","=",0);

What I did was replace the "OR" part of the original code with a check for the checkbox. If it is set and has a value of 'yes' then the expression will be true and "OR" will be used. If the expression is false then the "AND" will be used.

I think this is a simpler and easier method than using the if statements, sorry for not suggesting this way from the beginning. If you do it like this you can get rid of the second Search server behavior as well as your custom if statements. Please give this a try and let me know if you need any further help with it.

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





Ease of use


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