AnsweredAssumed Answered

PHP Filemaker OR Find

Question asked by jud420 on Sep 24, 2009
Latest reply on Sep 26, 2009 by littledog

Title

PHP Filemaker OR Find

Your post

I am trying to use PHP to create a find request to perform an 'OR' find, but with values from the same field.   For instance, i have a field in my layout called name, and i am trying to return records for each item named 'ADD' and also each item named 'Math'.  I have tried to create this using a compound find with the following:

 

 

$compoundFind = $fm->newCompoundFindCommand('miniIntakeCategories'); $request1 = $fm->newFindRequest('miniIntakeCategories'); $request1->addFindCriterion('name', 'ADD'); $request2 = $fm->newFindRequest('miniIntakeCategories'); $request1->addFindCriterion('name', 'Math');       $compoundFind->add(1, $request1); $compoundFind->add(2, $request2);       $result = $compoundFind->execute();

 ...which only produces one record, and also with a regular find command set to the OR type like this:

 

 

$find = $fm->newFindCommand("miniIntakeCategories"); $find->setLogicalOperator('FILEMAKER_FIND_OR'); $find->addFindCriterion('name', 'ADD'); $find->addFindCriterion('name', 'Math');       $result = $find->execute();       $error = error_check($result);      

 ...which also only returns one result.

 

What can I do differently to return both results without having to create multiple find requests?

 

 

Outcomes