AnsweredAssumed Answered

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

Question asked by sanjay on Jul 30, 2013
Latest reply on Jul 30, 2013 by mikebeargie

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.....

Outcomes