/** * @covers \airmoi\FileMaker\FileMaker::newFindCommand */ public function testNewFindCommand() { $command = $this->fm->newFindCommand('sample'); if (!$GLOBALS['OFFICIAL_API']) { $this->assertInstanceOf(Command\Find::class, $command); } else { $this->assertInstanceOf(\FileMaker_Command_Find::class, $command); } $command->addFindCriterion('id', FileMaker::FIND_GT . '25'); $result = $command->execute(); if (!$GLOBALS['OFFICIAL_API']) { $this->assertInstanceOf(Object\Result::class, $result); } else { $this->assertInstanceOf(\FileMaker_Result::class, $result); } $this->assertEquals(25, $result->getFoundSetCount()); }
require_once '../server_data.php'; require_once 'FileMaker.php'; require_once '../FX_Fuzzy_Debugger.php'; if (DEBUG_FUZZY) { $messageType = 'Fuzzy'; } else { $messageType = 'F.A.P.'; } if (isset($_POST['find_records'])) { // a search is only preformed if the form was submitted // by placing the form values in an array, we can loop to set all of our find criteria $searchRecordsArray = array('First_Namer' => $_POST['fname'], 'Last_Name' => $_POST['lname'], 'Phone_1 ' => $_POST['phone']); // configure a connection to FileMaker Server Advanced $contactsListConnection = new FileMaker('Contacts.fp7', $serverIP . ':' . $webCompanionPort, $webUN, $webPW); // set database and layout information $contactsListQuery = $contactsListConnection->newFindCommand('web_list'); // add find parameters foreach ($searchRecordsArray as $fieldName => $fieldValue) { $contactsListQuery->addFindCriterion($fieldName, $fieldValue); } // retrieve the records in this database matching the specified parameters available to the current user $contactsObject = $contactsListQuery->execute(); } else { // otherwise, find all records // configure a connection to FileMaker Server Advanced $contactsListConnection = new FileMaker('Contacts.fp7', $serverIP . ':' . $webCompanionPort, $webUN, $webPW); // create a new findall query $contactsListQuery = $contactsListConnection->newFindAllCommand('web_list'); // perform query $contactsObject = $contactsListQuery->execute(); }
<!-- <script src="scripts/array.js"></script> --> <?php define('FM_HOST', '127.0.0.1'); define('FM_FILE', 'sportsdev'); define('FM_USER', 'sifatsultan'); define('FM_PASS', 'pizzahut20'); # this is the include for the API for PHP require_once 'FileMaker.php'; # instantiate a new FileMaker object $sportslogin = new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS); /*********************************** QUERY PLAYER STATS AVGMETRESPERCARRY ************************************/ //find 'Tplayers2' $personnel_find = $sportslogin->newFindCommand('Tplayers2'); //build query array $personnel_findCriterions = array('fteam_name' => 'Waratahs'); foreach ($personnel_findCriterions as $key => $value) { $personnel_find->AddFindCriterion($key, $value); } //[doubt] // fmsSetPage($personnel_result,'Tplayers2',3); //sort data by 'avg metres per carry' $personnel_find->addSortRule('R_avgmetrespercarry', 1, FILEMAKER_SORT_DESCEND); //execute query $personnel_result = $personnel_find->execute(); // if(FileMaker::isError($personnel_result)){ // // fmsTrapError($personnel_result,"error.php"); // echo "Error"; // }
<pre> <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); //require_once 'db.php'; require_once 'vendor/FileMaker.php'; $fm_file = 'TestingMaddox'; $fm_host = '54.246.190.236'; $fm_user = '******'; $fm_pass = '******'; $layout_name = 'a.webXML'; $fm = new FileMaker($fm_file, $fm_host, $fm_user, $fm_pass); //$cmd = $fm->newAddCommand($layout_name); $email = "*****@*****.**"; $findCommand = $fm->newFindCommand($layout_name); $findCommand->addFindCriterion("email", "==" . $email); $result = $findCommand->execute(); //var_dump($result); // //$cmd->setField("nameTitle", "Mr"); //$cmd->setField("nameFirst", "Jacob"); //$cmd->setField("nameSurname", "Gwiazdowski"); //$cmd->setField("email", "*****@*****.**"); //$cmd->setField("telephoneLandHome", "01223308040"); //$cmd->setField("fKeyCampaign", "431"); //$cmd->setField("fKeyOpener", "280"); //$cmd->setField("subscriptionStatus", "1"); // // //