Search code examples
phpdatefindfilemaker

Filemaker PHP API date range find


I am trying to find a certain set of data from my Filemaker DB, for example

$fm = new FileMaker(****, ****, ****, ****);

$find = $fm->newFindCommand('MyLayout');

$find->addFindCriterion('Start_Date','07/01/2011');

$results = $find->execute();

This returns all of the data from my layout but does not use the find criterion.

any ideas?


Solution

  • Be sure to check for an error before you show the results.

    If $notFound = true then you could display some other message.

    // check for an error in result
    if (FileMaker::isError($results)) {
        if ($results->code != 401) {
          echo 'unable to find data: ' . $results->message . '(' . $results->code . ')';
          die();
        }
        else $notFound = true;
    }