rj.rijo

Help with using filemaker api for php?

Discussion created by rj.rijo on Dec 15, 2015
Latest reply on Dec 16, 2015 by nicolai

hello my name is rijo, and im new to filemaker.

im referring this book - filemaker api for php 13 by Todd Duell.

i need help with the line of code which is given on page number 46,

 

PHP Script

<?php include ("../../dbaccess.php");

$request = $fm->newFindAllCommand('Demo php');

$result = $request->execute();

if (FileMaker::isError($result))

{

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

exit;

}

$records = $result->getRecords();

echo '<table border="1">

<tr>

<th>First Name</th>

<th>Last Name</th>

<th>Number Number</th>

<th>Date</th>

<th>Time Stamp</th>

<th>Calculation</th>

<th>Record ID</th>

</tr>';

foreach ($records as $record)

{

echo '<tr>';

echo '<td>' . $record->getField('FirstName') .'</td>';

echo '<td>' . $record->getField('LastName') . '</td>';

echo '<td>' . $record->getField('Number') . '</td>';

echo '<td>' . $record->getField('Date') . '</td>';

echo '<td>' . $record->getField('TimeStamp') .'</td>';

echo '<td>' . $record->getField('Calculation') .

'</td>';

echo '<td>' . $record->getField('RecordID') . '</td>';

echo '</tr>';

}

echo '</table>';

?>

 

i have some basic knowledge of php but im not able to understand the following line of code...

 

$request = $fm->newFindAllCommand('Demo php');

$result = $request->execute();

if (FileMaker::isError($result))

{

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

exit;

}

$records = $result->getRecords();

Outcomes