Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Findall Command Failing With Calculation Involving Linked Database


This topic is 5085 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hello,

I've been searching everywhere for a solution to this problem, I hope someone here can help! I'm trying to build a flash application that uses php to retrieve information from a FileMaker database, so that it can be put into a UI used for employee scheduling. The short story goes like this:

The php file is interfacing with one large database that contains more or less all information about the company, the employees, their hourly rates, the jobs they are working on, etc. This database is referencing another database that contains contact info for clients. To test out how php interacts with the Filemaker API, i've built a simple application that gets data from a layout with only two fields: a job number, and a client and job. The job number is a simple calculation that ensures there are no duplicate job numbers, and it does not reference the contacts database. The client and job field gets the job name from the main database, then retrieves the name of the client the job is being done for from the contacts database, and concatenates it on to the job name. When I try to perform a FindAll command on this layout, the layout object is successfully retrieved, the FindAll command is successfully created, a SortRule is successfully created, but when execute() is called, the program crashes silently. Both databases have php enabled, and both have all privileges enabled for the user name that the php script is connecting to the database with. I've scoured every forum and every filemaker setting, and i suspect that the failure has something to do with the calculation involving a linked database, but I can't figure out how to fix it. Does anyone know what might be causing this??

the relevant code follows, with the specifics of my database changed for privacy:

require_once('FileMaker.php');

$fm = new FileMaker('myDatabase', 'myHostSpec' , 'myUserName' , 'myPassword');

$layout ="Artist Utility Page tied to Tracker";

$recordFind =& $fm->newFindAllCommand("$layout");

echo 'findallcommand created'; //prints

$recordFind->addSortRule('Creation timestamp', 1, FILEMAKER_SORT_DESCEND);

echo 'sort rule added'; //prints

$resultObject = $recordFind->execute();

print "resultObject initialized"; //does not print.

Posted

It sounds to me like you are getting a PHP error, since the script stops part way through. To see the error, make sure PHP is configured to display errors. In your php.ini config file error_reporting should equal E_ALL like:

error_reporting = E_ALL

I think that's the first step to troubleshooting this.

Posted

In principle there's nothing wrong with what you're doing... (i'd be curious to know what you omitted) but try this.


ini_set("display_errors","on");

error_reporting(E_ALL^E_NOTICE); // this may also have to be E_ALL^E_NOTICE^E_DEPRECATED depending on what version of php you're running.



require_once('FileMaker.php');



$fm = new FileMaker('myDatabase', 'myHostSpec' , 'myUserName' , 'myPassword');



$layout ="Artist Utility Page tied to Tracker";



$recordFind = $fm->newFindAllCommand($layout);

$recordFind->addSortRule('Creation timestamp', 1, FILEMAKER_SORT_DESCEND);



echo "pre-execute";

$resultObject = $recordFind->execute();

echo "post-execute";



This topic is 5085 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.