Author Archive for Robin Story

FMPHP: Passing an array of values and performance testing on adding records

In my previous post about the difference between the createRecord() and newAddCommand() functions in PHP, Anders Monsen asked in comments:

I’ve never tried the createRecord method, but the ability to send an array of field values in the method seems very interesting. How would you format this data in the $values array?
$rec =& $fm->createRecord(‘Form View’, $values);
The PHP API lacks good examples of each of the methods in the class, and this post brings attention to an alternate method to set data, though I’m not certain when it might be useful, aside from bypassing the large XML array in the $result. Might be worth a try to see the differences in performance.

So two worthy questions, for which I have answers! Continue reading ‘FMPHP: Passing an array of values and performance testing on adding records’

 

FMPHP: The difference between createRecord() and newAddCommand()

If you’ve been looking at building custom PHP scripts to add records to your FileMaker database, you might have come across the following snippet from the Custom Web Publishing with PHP document:

There are two ways to create a record:

  • Use the createRecord() method, specifying a layout name, and optionally specifying an array of field values. You can also set values individually in the new record object.The createRecord() method does not save the new record to the database. To save the record to the database, call the commit() method.
    For example:
    $rec =& $fm->createRecord('Form View', $values);
    $result = $rec->commit();
  • Use the Add command. Use the newAddCommand() method to create a FileMaker_Command_Add object, specifying the layout name and an array with the record data. To save the record to the database, call the execute() method.
    For example:
    $newAdd =& $fm->newAddCommand('Respondent', $respondent_data);
    $result = $newAdd->execute();

Which is somewhat helpful, but many people wonder what the substantive difference is between these two statements. Continue reading ‘FMPHP: The difference between createRecord() and newAddCommand()’

 

Building robust error logs in FileMaker 11

As FileMaker developers, we have all had the experience when a user contacts us regarding a discovered glitch in our systems. And, because users aren’t developers, they may not be able to provide the most accurate information regarding what they were doing on which layout when said glitch happened.

It is possible to set up a FileMaker system to trap for error logs, however. There are a number of tools available to a developer to better track what’s going on with data so that when a user calls you with less-than-clear error reports, you can still track down the source of the problem. Continue reading ‘Building robust error logs in FileMaker 11′

 
Pages: 1 2 3 4 5

Advancing Technique: Using Booleans to streamline data

While it may seem that in life there are very few black and white choices, in the database development world, the either/or option (on/off, yes/no, active/inactive, open/closed) is pretty common. We know these choices as Boolean options. Continue reading ‘Advancing Technique: Using Booleans to streamline data’