Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Findall Command Failing With Calculation Involving Linked Database

Featured Replies

  • Newbies

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.

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.

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";



Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.