I have yet another question that I can't seem to figure out the reason/cause.
In a php file I simply created the following codes:
<?php
session_start();
define('FM_HOST', '**Hidden**');
define('FM_FILE', '**Hidden**');
define('FM_USER', '**Hidden**');
define('FM_PASS', '**Hidden**');
ini_set("include_path", ".:/Library/WebServer/Documents/");
include ('FileMaker.php');
require_once('FileMaker.php');
error_reporting(0);
ini_set('display_errors', '0');
$ttstemp = $_POST['prefix'].'-'.$_POST['noyear'].$_POST['nomonth'];
$fm = new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS);
if (isset($_SESSION['record']) && $_SESSION['record'] !="") {
$request = $fm->newAddCommand('form_api');
$request->setField('no_ref', $ttstemp );
$request->setField('PO', $_POST['po']);
$result = $request->execute();
$records = $result->getRecords();
$found = $result->getFoundSetCount();
$_SESSION['ent'] = $records[0]->getRecordId();
For some reasons if I disable the line "$request->setField('no_ref', $ttstemp );" it works perfectly but if I remove the comment and let it run it returns the following error:
Fatal error: Call to undefined method FileMaker_Error::getRecords() in /Library/WebServer/Documents/itrack/updatesave.php on line 66
line 66 is $records = $result->getRecords();
I have no idea what is happening... What is so wrong about "$request->setField('no_ref', $ttstemp );"............