Hi geek_girl,
Thanks for reply. And I tried in search.php
if($aRequestParams['Sex'] == 'both'){
$aRequestParams['Sex'] = 'female' || $aRequestParams['Sex'] = 'male';
}
another try is
if($aRequestParams['Sex'] == 'both'){
$aRequestParams['Sex'] = 'female' ? 'female' : 'male';
}
and another try is
if($aRequestParams['Sex'] == 'both'){
$aRequestParams['Sex'] = 'female' || 'male';
}
But I am getting output for female alone not for male .
How do I write condition for searching for both sex if it is female or male.
The query does an AND on the fields; the module I posted will allow you to set up a search form where the user can check male and female boxes and then the search should return both male and female.
However, think about what you have coded; walk through the code saying it out loud.
$aRequestParams['Sex'] = 'female' || $aRequestParams['Sex'] = 'male'
This is saying set the value in the array to female or set the value to male. It does not make any sense here.
$aRequestParams['Sex'] = 'female' ? 'female' : 'male';
This is a shorten form of an if:else statement.
I am guessing that you want a selection in sex in the search for "Both". and you want to rewrite the search so that both does an AND on "male" and "female" I still say the module I listed is the easiest and best way to go about building better search forms in Dolphin.