Tag Archive for 'PHP'

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()’

 

Crossing Drupal

There has been a lot of buzz floating around the web regarding the content management system called Drupal.  Over the next couple of weeks I am going to investigate this growing platform from the perspective of a FileMaker developer.  Drupal is not a Filemaker replacement, but there are definite use cases where Drupal is an ideal content management choice. Instead of my regular posts about filemaker techniques, I will explore how Drupal is similar and different from my platform of choice.  With a nod to a good movie about exploring other cultures (Crossing Delancey) I am calling this series Crossing Drupal.

In this first installment I would like to simply lay out some simple terms, so we can all speak the same language.  A rosetta stone if you will.
rosetta-stone2 Continue reading ‘Crossing Drupal’

 

Meeting Recap: Matt O’Dell of FMI on Server Side Script Sequencing (Video)

Thanks to Matt for coming down from NY to present!  And to FileMaker Inc. for allowing us to present a recording of the session.

The uStream recording is here.

Matt’s presentation covered some of the advertised uses of Script Sequences – namely sequencing external batch or shell scripts with FileMaker scripts to extend the capabilities of FileMaker Server for things like imports/exports. Continue reading ‘Meeting Recap: Matt O’Dell of FMI on Server Side Script Sequencing (Video)’