0 Replies Latest reply on Oct 2, 2012 1:56 PM by joel0903

    I am new to Filemaker and need some help with an error I am getting using the API

    joel0903

      Here is my php try block. I have also checked to make sure the FileMaker object is instantiated and it appears to have be correct (the site I'm working on uses it other places). I have manually looked at the database table in question and made sure the value is in the table. I've also tried other tables and criteria. Any help would be greatly appreciated.

       

      $DiakonObj is in an included file but looks like this:

       

      $DiakonObj = new FileMaker($DB_NAME, $DB_HOST, $DB_USER, $DB_PASS);

       

      try{

      $roomRate = findInDatabase2('CITIES_PHP', array('cc_Date10'=>'6/30/2012'));

       

        if( !FileMaker::isError($roomRate) ){

       

      echo "not an error...<br>";

      print_r($roomRate);

      $rate = $roomRate->getRecords();

        }else{

      echo "<br>Error....<br><br>"; //This is always coming back as an error.

      //print_r($roomRate); //Print the error object properties

        }

      }catch(Exception $a){

      echo "exception a<br>";

      }

       

      function findInDatabase2($dbTable, $findCriteriaArray){

      global $DiakonObj;

       

         try{

      $findDBObj = $DiakonObj->newFindCommand($dbTable); //choose db table

          $findDBObj->addSortRule($sortBy,1,FILEMAKER_SORT_ASCEND);

       

      echo "Filemaker Find Object Created:<br>";

      print_r($findDBObj);

       

      echo "<br>----------------------------------------------------------------------------<br>";

       

      foreach( $findCriteriaArray as $field => $val ){

      $findDBObj->AddFindCriterion($field, empty($val) ? '=' : $val);

          }

      $retObj = $findDBObj->execute(); //returning a filemaker error object

       

      echo "<br>Filemaker Result or Error Object Created:<br>";

          print_r($retObj);

       

      echo "<br>----------------------------------------------------------------------------<br>";

       

      return $retObj;

       

         }catch (Exception $e){

      echo "exception: " ;

         }

        }

       

      This is the result of the TWO print_r statements in findInDatabase2:

      print_r($findDBObj) produces

      Filemaker Find Object Created:

      FileMaker_Command_Find Object ( [_impl] => FileMaker_Command_Find_Implementation Object ( [_findCriteria] => Array ( ) [Vd65662c5] => Array ( [1] => ) [Va9136a07] => Array ( [1] => ascend ) [Vf951bdce] => [V83f28691] => [V85fd701e] => [V6da136ea] => [V568aa2ec] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://173.8.59.242 [recordClass] => FileMaker_Record [prevalidate] => [database] => Diakon Events Management_DATA [username] => cancunwebsite [password] => EYhpetxyQh ) [Vea4b3413] => [V9a3dcbce] => ) [_layout] => CITIES_PHP [V7a2db0ea] => [_script] => [_scriptParams] => [_preReqScript] => [_preReqScriptParams] => [_preSortScript] => [_preSortScriptParams] => [V0b9a204c] => FileMaker_Record [_recordId] => ) )

      ----------------------------------------------------------------------------

       

      print_r($retObj) productes (this is the returnObject from $findDBObj->execute();

      Filemaker Result or Error Object Created:

      FileMaker_Error Object ( [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://173.8.59.242 [recordClass] => FileMaker_Record [prevalidate] => [database] => Diakon Events Management_DATA [username] => cancunwebsite [password] => EYhpetxyQh ) [Vea4b3413] => [V9a3dcbce] => ) [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => 102 [message] => [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/FileMaker/Error.php [line] => 52 [function] => PEAR_Error [class] => PEAR_Error [object] => FileMaker_Error Object *RECURSION* [type] => -> [args] => Array ( [0] => [1] => 102 ) ) [1] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/FileMaker/Implementation/Parser/FMResultSet.php [line] => 48 [function] => FileMaker_Error [class] => FileMaker_Error [object] => FileMaker_Error Object *RECURSION* [type] => -> [args] => Array ( [0] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://173.8.59.242 [recordClass] => FileMaker_Record [prevalidate] => [database] => Diakon Events Management_DATA [username] => cancunwebsite [password] => EYhpetxyQh ) [Vea4b3413] => [V9a3dcbce] => ) [1] => [2] => 102 ) ) [2] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/FileMaker/Implementation/CommandImpl.php [line] => 84 [function] => parse [class] => FileMaker_Parser_FMResultSet [object] => FileMaker_Parser_FMResultSet Object ( [Vcb5e100e] => 102 [Vf5bf48aa] => Array ( [build] => 06/21/2012 [name] => FileMaker Web Publishing Engine [version] => 12.0.2.228 ) [V1ea7e575] => Array ( [database] => [date-format] => [layout] => [table] => [time-format] => [timestamp-format] => [total-count] => 0 ) [V9f81f3c0] => Array ( ) [Vaae0d98d] => Array ( [count] => 0 [fetch-size] => 0 ) [Vae581270] => Array ( ) [V6e52c40b] => Array ( ) [Ve13f1c92] => [V43432a31] => [V51bc3e3b] => [V26005321] => [V6468d939] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://173.8.59.242 [recordClass] => FileMaker_Record [prevalidate] => [database] => Diakon Events Management_DATA [username] => cancunwebsite [password] => EYhpetxyQh ) [Vea4b3413] => [V9a3dcbce] => ) [V5431b8d4] => Resource id #41 [V6de51026] => [_result] => [_layout] => ) [type] => -> [args] => Array ( [0] => ) ) [3] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/FileMaker/Implementation/Command/FindImpl.php [line] => 42 [function] => _getResult [class] => FileMaker_Command_Implementation [object] => FileMaker_Command_Find_Implementation Object ( [_findCriteria] => Array ( [cc_Date10] => 6/30/2012 ) [Vd65662c5] => Array ( [1] => ) [Va9136a07] => Array ( [1] => ascend ) [Vf951bdce] => [V83f28691] => [V85fd701e] => [V6da136ea] => [V568aa2ec] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://173.8.59.242 [recordClass] => FileMaker_Record [prevalidate] => [database] => Diakon Events Management_DATA [username] => cancunwebsite [password] => EYhpetxyQh ) [Vea4b3413] => [V9a3dcbce] => ) [_layout] => CITIES_PHP [V7a2db0ea] => [_script] => [_scriptParams] => [_preReqScript] => [_preReqScriptParams] => [_preSortScript] => [_preSortScriptParams] => [V0b9a204c] => FileMaker_Record [_recordId] => ) [type] => -> [args] => Array ( [0] => ) ) [4] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/FileMaker/Command.php [line] => 137 [function] => execute [class] => FileMaker_Command_Find_Implementation [object] => FileMaker_Command_Find_Implementation Object ( [_findCriteria] => Array ( [cc_Date10] => 6/30/2012 ) [Vd65662c5] => Array ( [1] => ) [Va9136a07] => Array ( [1] => ascend ) [Vf951bdce] => [V83f28691] => [V85fd701e] => [V6da136ea] => [V568aa2ec] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://173.8.59.242 [recordClass] => FileMaker_Record [prevalidate] => [database] => Diakon Events Management_DATA [username] => cancunwebsite [password] => EYhpetxyQh ) [Vea4b3413] => [V9a3dcbce] => ) [_layout] => CITIES_PHP [V7a2db0ea] => [_script] => [_scriptParams] => [_preReqScript] => [_preReqScriptParams] => [_preSortScript] => [_preSortScriptParams] => [V0b9a204c] => FileMaker_Record [_recordId] => ) [type] => -> [args] => Array ( ) ) [5] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/html/testRoom.html.php [line] => 50 [function] => execute [class] => FileMaker_Command [object] => FileMaker_Command_Find Object ( [_impl] => FileMaker_Command_Find_Implementation Object ( [_findCriteria] => Array ( [cc_Date10] => 6/30/2012 ) [Vd65662c5] => Array ( [1] => ) [Va9136a07] => Array ( [1] => ascend ) [Vf951bdce] => [V83f28691] => [V85fd701e] => [V6da136ea] => [V568aa2ec] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://173.8.59.242 [recordClass] => FileMaker_Record [prevalidate] => [database] => Diakon Events Management_DATA [username] => cancunwebsite [password] => EYhpetxyQh ) [Vea4b3413] => [V9a3dcbce] => ) [_layout] => CITIES_PHP [V7a2db0ea] => [_script] => [_scriptParams] => [_preReqScript] => [_preReqScriptParams] => [_preSortScript] => [_preSortScriptParams] => [V0b9a204c] => FileMaker_Record [_recordId] => ) ) [type] => -> [args] => Array ( ) ) [6] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/html/testRoom.html.php [line] => 14 [function] => findInDatabase2 [args] => Array ( [0] => CITIES_PHP [1] => Array ( [cc_Date10] => 6/30/2012 ) ) ) [7] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/templates/main.php [line] => 51 [args] => Array ( [0] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/html/testRoom.html.php ) [function] => require_once ) [8] => Array ( [file] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/testRoom.php [line] => 134 [args] => Array ( [0] => /Volumes/Data/Web/cancun.jhilburnpartners.com/register/includes/templates/main.php ) [function] => require_once ) ) [callback] => )