Search code examples
filemaker

Filemaker: No records match the request


I am newbie with filemaker. I am trying to set search function but something wrong and it returns No records match the request even if it is present there. Here is code

public function get_row($table, $search='')
{
    $layout_object = $this->fm->getLayout($table);
    if (FileMaker::isError($layout_object)) {
        return array();
    }

    $request = $this->fm->newFindCommand($table);
    if ($search)
    {
        $request->addFindCriterion($search['key'], '[email protected]'); // hardcoded. 
    }
    $result = $request->execute();
    if (FileMaker::isError($result)) {
        echo $result->getErrorString();
    }
            //.....Result: No records match the request 

} 

what I am doing wrong?


Solution

  • You need to escape the @ symbol as it's a special character in Find mode to match any one character, so try this:

    $request->addFindCriterion($search['key'], 'hh\@kkk.nn'); // hardcoded.