8
It gets weirder!...
I've tidied the code a little. Don't need the mySQL wildcards so...
if ( !empty($HTTP_POST_VARS['interest']) ) {
$criteria = new CriteriaCompo(new Criteria('interest1',$myts->addSlashes(trim($HTTP_POST_VARS['interest']))));
$criteria->add(new Criteria('interest2', $myts->addSlashes(trim($HTTP_POST_VARS['interest']))), 'OR');
$criteria->add(new Criteria('interest3', $myts->addSlashes(trim($HTTP_POST_VARS['interest']))), 'OR');
$criteria->add(new Criteria('interest4', $myts->addSlashes(trim($HTTP_POST_VARS['interest']))), 'OR');
}
add to this another form field choice for location - another select pull down
if ( !empty($HTTP_POST_VARS['location']) ) {
$criteria->add(new Criteria('location', $myts->addSlashes(trim($HTTP_POST_VARS['location']))));
}
and in the sql debug window you get the expected SQL...
SELECT * FROM xoops_users WHERE (interest1 = 'Camping' OR interest2 = 'Camping' OR interest3 = 'Camping' OR interest4 = 'Camping' AND location = 'Andorra' AND level > 0) ORDER BY uname ASC LIMIT 0, 20
but XOOPS ( here, I imagine, $foundusers =& $member_handler->getUsers($criteria, true); ) returns all users who like camping not just the one in Andorra.
Huh?!
Help!
Andrew