Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimonostereo/f9b6535bfe1a750bf050 to your computer and use it in GitHub Desktop.
Save kimonostereo/f9b6535bfe1a750bf050 to your computer and use it in GitHub Desktop.
Use this code to search for a record, then grab the record ID
<?php
include ("/www/htdocs/fmphp/access.php");
$find = $fm->newFindCommand('Table');
// use == for an exact search!
$find->addFindCriterion('id',"==". $_POST['id']);
$find->addFindCriterion('student_id',"==". $_POST['student_id']);
$result = $find->execute();
// check for errors
$error = Filemaker::isError($result);
if (!$error) {
$records = $result->getRecords();
// grab the record id for the found record
$recID = $records[0]->getRecordId();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment