5 Replies Latest reply on Jul 30, 2013 7:43 AM by mikebeargie

    getRecord() fetch only last record all time in foreach loop

    sanjay

      Hi,

      I am use folloeing code for fetch all record from database but all time its show only last record from database.

      // Create FileMaker_Command_Find on layout to search

      $findCommand = $fm->newFindAllCommand('eventsPHX');

       

       

      // Execute find command

      $result = $findCommand->execute();

       

      if (FileMaker::isError($result)) {

      echo "Error: " . $result->getMessage() . " ";

      exit;

      }

       

       

       

      // Get array of found records

      $records = $result->getRecords();

       

       

       

       

      // Print out found records

       

      // Setup row count variable to alternate row background color

      $row = 0;

       

      foreach ($records as $record) {

       

      //echo "<td class="align-left"><a href="viewRecord.php?recid=" . $record->getRecordId() . "">" .

      echo $record->getField('doctor')." ".$record->getField('time');

      echo "<br>";

      $tu=$record->getField('date');

      print_r($tu);

      echo "<br>";

      }

       

      Please help if you have any ides.....