Created
March 18, 2016 22:48
-
-
Save kimonostereo/3ef589ff19c110c7b799 to your computer and use it in GitHub Desktop.
Simple search using $fullname as the submitted search criteria.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#Set the variable for the POSTed search criteria | |
$fullname = $_POST['fullname']; | |
#create the find command and specify the layout | |
//$request =& $fm->newFindCommand('Layout #1'); | |
$findCommand =& $fm->newFindCommand('Layout #1'); | |
#Specify the field and value to match against. | |
//$request->addFindCriterion('fullname', $fullname); | |
$findCommand->addFindCriterion('fullname', $fullname); | |
//Perform the find | |
$result = $findCommand->execute(); | |
#Check for an error | |
if (FileMaker::isError($result)) { | |
echo "<p>Error: " . $result->getMessage() . "</p>"; | |
exit; | |
} | |
#Store the matching record | |
$records = $result->getRecords(); | |
#Cycle through each record result | |
foreach ($records as $record) { | |
#Get the 'Record Name' field from the record and display it | |
echo "<p>First record is for " . $record->getField('lastname') . "</p>"; | |
#Get the 'Description' field from the record and display it | |
echo "<p>The phone number is: " . $record->getField('phone') . "</p>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment