13 Replies Latest reply on Mar 19, 2015 7:30 AM by disabled_ntaylor

    PHP API Fails to Return Multiple Records Using getRelatedSet()

    millennium

      Summary

      PHP API Fails to Return Multiple Records Using getRelatedSet()

      Product

      FileMaker Server

      Version

      13

      Operating system version

      Mac OSX Yosemite

      Description of the issue

      Following authentication using the FileMaker API through PHP, we are able to return the field values for the found record, but we are unable to return the field values for the related records.  The correct number of rows in the related set array are returned, but each row contains the same record value, which is the last in the set.  We are using the foreach () method to display the related records.  The PHP files and webserver are hosted in the cloud and the FileMaker database is on a private server.

      Steps to reproduce the problem

      Host the db1.fmp12 file on a FileMaker server accessible to the web.
      Host the db1...php files on a webserver other than the FileMaker server.  Zip of PHP and database files is available at https://www.charitypilot.org/FMS/db1.zip
      Login using Admin/asdfasdfasdf and view the results and debug information provided.

      or

      View https://www.charitypilot.org/FMS/db1index.php using the above credentials.

      Expected result

      Parent1 record
        Child1 record
        Child2 record

      i.e.

      George Jetson
        Elroy Jetson
        Judy Jetson

      Expected results can also be seen via WebDirect at https://fms.charitypilot.org:2443/fmi/webd?#db1
      Login using Admin/asdfasdfasdf to confirm one parent and two different child records.

      Actual result

      Parent1 record
        Child2 record
        Child2 record

      i.e.

      George Jetson
        Judy Jetson
        Judy Jetson

      Exact text of any error message(s) that appear

      PHP Test

      This is parentID: 1

      This is the parentFirst: George

      This is the parentLast: Jetson

      Here are the children:

      childFirst: Judy  childLast: Jetson

      childFirst: Judy  childLast: Jetson

      Here is the debug information:

      FileMaker_Record Object
      (
          [_impl] => FileMaker_Record_Implementation Object
              (
                  [_fields] => Array
                      (
                          [children::childID] => Array
                              (
                                  [0] => 2
                              )

                          [children::childFirst] => Array
                              (
                                  [0] => Judy
                              )

                          [children::childLast] => Array
                              (
                                  [0] => Jetson
                              )

                      )

                  [V5e7ec2d5] => Array
                      (
                      )

                  [_recordId] => 2
                  [_modificationId] => 0
                  [_layout] => FileMaker_RelatedSet Object
                      (
                          [_impl] => FileMaker_RelatedSet_Implementation Object
                              (
                                  [_layout] => FileMaker_Layout Object
                                      (
                                          [_impl] => FileMaker_Layout_Implementation Object
                                              (
                                                  [_fm] => FileMaker_Implementation Object
                                                      (
                                                          [V73ee434e] => Array
                                                              (
                                                                  [charset] => UTF-8
                                                                  [locale] => en
                                                                  [logLevel] => 3
                                                                  [hostspec] => https://fms.charitypilot.org
                                                                  [recordClass] => FileMaker_Record
                                                                  [prevalidate] =>
                                                                  [database] => db1
                                                                  [username] => Admin
                                                                  [password] => asdfasdfasdf
                                                              )

                                                          [Vea4b3413] =>
                                                          [V9a3dcbce] =>
                                                      )

                                                  [_name] => parents
                                                  [_fields] => Array
                                                      (
                                                          [parentID] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                          [parentFirst] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                          [parentLast] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                      )

                                                  [_relatedSets] => Array
                                                      (
                                                          [children] => FileMaker_RelatedSet Object
      *RECURSION*
                                                      )

                                                  [_valueLists] => Array
                                                      (
                                                      )

                                                  [Vab234ad8] => Array
                                                      (
                                                      )

                                                  [_database] => db1
                                                  [_extended] =>
                                              )

                                      )

                                  [_fm] => FileMaker_Implementation Object
                                      (
                                          [V73ee434e] => Array
                                              (
                                                  [charset] => UTF-8
                                                  [locale] => en
                                                  [logLevel] => 3
                                                  [hostspec] => https://fms.charitypilot.org
                                                  [recordClass] => FileMaker_Record
                                                  [prevalidate] =>
                                                  [database] => db1
                                                  [username] => Admin
                                                  [password] => asdfasdfasdf
                                              )

                                          [Vea4b3413] =>
                                          [V9a3dcbce] =>
                                      )

                                  [_name] => children
                                  [_fields] => Array
                                      (
                                          [children::childID] => FileMaker_Field Object
                                              (
                                                  [_impl] => FileMaker_Field_Implementation Object
                                                      (
                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                          [_name] => children::childLast
                                                          [_autoEntered] =>
                                                          [_global] =>
                                                          [_maxRepeat] => 1
                                                          [_validationMask] => 0
                                                          [_validationRules] => Array
                                                              (
                                                              )

                                                          [_result] => text
                                                          [_type] => normal
                                                          [_valueList] =>
                                                          [_styleType] =>
                                                          [_maxCharacters] => 0
                                                      )

                                              )

                                          [children::childFirst] => FileMaker_Field Object
                                              (
                                                  [_impl] => FileMaker_Field_Implementation Object
                                                      (
                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                          [_name] => children::childLast
                                                          [_autoEntered] =>
                                                          [_global] =>
                                                          [_maxRepeat] => 1
                                                          [_validationMask] => 0
                                                          [_validationRules] => Array
                                                              (
                                                              )

                                                          [_result] => text
                                                          [_type] => normal
                                                          [_valueList] =>
                                                          [_styleType] =>
                                                          [_maxCharacters] => 0
                                                      )

                                              )

                                          [children::childLast] => FileMaker_Field Object
                                              (
                                                  [_impl] => FileMaker_Field_Implementation Object
                                                      (
                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                          [_name] => children::childLast
                                                          [_autoEntered] =>
                                                          [_global] =>
                                                          [_maxRepeat] => 1
                                                          [_validationMask] => 0
                                                          [_validationRules] => Array
                                                              (
                                                              )

                                                          [_result] => text
                                                          [_type] => normal
                                                          [_valueList] =>
                                                          [_styleType] =>
                                                          [_maxCharacters] => 0
                                                      )

                                              )

                                      )

                              )

                      )

                  [_fm] => FileMaker_Implementation Object
                      (
                          [V73ee434e] => Array
                              (
                                  [charset] => UTF-8
                                  [locale] => en
                                  [logLevel] => 3
                                  [hostspec] => https://fms.charitypilot.org
                                  [recordClass] => FileMaker_Record
                                  [prevalidate] =>
                                  [database] => db1
                                  [username] => Admin
                                  [password] => asdfasdfasdf
                              )

                          [Vea4b3413] =>
                          [V9a3dcbce] =>
                      )

                  [_relatedSets] => Array
                      (
                      )

                  [_parent] => FileMaker_Record Object
                      (
                          [_impl] => FileMaker_Record_Implementation Object
                              (
                                  [_fields] => Array
                                      (
                                          [parentID] => Array
                                              (
                                                  [0] => 1
                                              )

                                          [parentFirst] => Array
                                              (
                                                  [0] => George
                                              )

                                          [parentLast] => Array
                                              (
                                                  [0] => Jetson
                                              )

                                      )

                                  [V5e7ec2d5] => Array
                                      (
                                      )

                                  [_recordId] => 1
                                  [_modificationId] => 0
                                  [_layout] => FileMaker_Layout Object
                                      (
                                          [_impl] => FileMaker_Layout_Implementation Object
                                              (
                                                  [_fm] => FileMaker_Implementation Object
                                                      (
                                                          [V73ee434e] => Array
                                                              (
                                                                  [charset] => UTF-8
                                                                  [locale] => en
                                                                  [logLevel] => 3
                                                                  [hostspec] => https://fms.charitypilot.org
                                                                  [recordClass] => FileMaker_Record
                                                                  [prevalidate] =>
                                                                  [database] => db1
                                                                  [username] => Admin
                                                                  [password] => asdfasdfasdf
                                                              )

                                                          [Vea4b3413] =>
                                                          [V9a3dcbce] =>
                                                      )

                                                  [_name] => parents
                                                  [_fields] => Array
                                                      (
                                                          [parentID] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
                                                                              (
                                                                                  [_impl] => FileMaker_RelatedSet_Implementation Object
                                                                                      (
                                                                                          [_layout] => FileMaker_Layout Object
      *RECURSION*
                                                                                          [_fm] => FileMaker_Implementation Object
                                                                                              (
                                                                                                  [V73ee434e] => Array
                                                                                                      (
                                                                                                          [charset] => UTF-8
                                                                                                          [locale] => en
                                                                                                          [logLevel] => 3
                                                                                                          [hostspec] => https://fms.charitypilot.org
                                                                                                          [recordClass] => FileMaker_Record
                                                                                                          [prevalidate] =>
                                                                                                          [database] => db1
                                                                                                          [username] => Admin
                                                                                                          [password] => asdfasdfasdf
                                                                                                      )

                                                                                                  [Vea4b3413] =>
                                                                                                  [V9a3dcbce] =>
                                                                                              )

                                                                                          [_name] => children
                                                                                          [_fields] => Array
                                                                                              (
                                                                                                  [children::childID] => FileMaker_Field Object
      *RECURSION*
                                                                                                  [children::childFirst] => FileMaker_Field Object
      *RECURSION*
                                                                                                  [children::childLast] => FileMaker_Field Object
      *RECURSION*
                                                                                              )

                                                                                      )

                                                                              )

                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                          [parentFirst] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
                                                                              (
                                                                                  [_impl] => FileMaker_RelatedSet_Implementation Object
                                                                                      (
                                                                                          [_layout] => FileMaker_Layout Object
      *RECURSION*
                                                                                          [_fm] => FileMaker_Implementation Object
                                                                                              (
                                                                                                  [V73ee434e] => Array
                                                                                                      (
                                                                                                          [charset] => UTF-8
                                                                                                          [locale] => en
                                                                                                          [logLevel] => 3
                                                                                                          [hostspec] => https://fms.charitypilot.org
                                                                                                          [recordClass] => FileMaker_Record
                                                                                                          [prevalidate] =>
                                                                                                          [database] => db1
                                                                                                          [username] => Admin
                                                                                                          [password] => asdfasdfasdf
                                                                                                      )

                                                                                                  [Vea4b3413] =>
                                                                                                  [V9a3dcbce] =>
                                                                                              )

                                                                                          [_name] => children
                                                                                          [_fields] => Array
                                                                                              (
                                                                                                  [children::childID] => FileMaker_Field Object
      *RECURSION*
                                                                                                  [children::childFirst] => FileMaker_Field Object
      *RECURSION*
                                                                                                  [children::childLast] => FileMaker_Field Object
      *RECURSION*
                                                                                              )

                                                                                      )

                                                                              )

                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                          [parentLast] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
                                                                              (
                                                                                  [_impl] => FileMaker_RelatedSet_Implementation Object
                                                                                      (
                                                                                          [_layout] => FileMaker_Layout Object
      *RECURSION*
                                                                                          [_fm] => FileMaker_Implementation Object
                                                                                              (
                                                                                                  [V73ee434e] => Array
                                                                                                      (
                                                                                                          [charset] => UTF-8
                                                                                                          [locale] => en
                                                                                                          [logLevel] => 3
                                                                                                          [hostspec] => https://fms.charitypilot.org
                                                                                                          [recordClass] => FileMaker_Record
                                                                                                          [prevalidate] =>
                                                                                                          [database] => db1
                                                                                                          [username] => Admin
                                                                                                          [password] => asdfasdfasdf
                                                                                                      )

                                                                                                  [Vea4b3413] =>
                                                                                                  [V9a3dcbce] =>
                                                                                              )

                                                                                          [_name] => children
                                                                                          [_fields] => Array
                                                                                              (
                                                                                                  [children::childID] => FileMaker_Field Object
      *RECURSION*
                                                                                                  [children::childFirst] => FileMaker_Field Object
      *RECURSION*
                                                                                                  [children::childLast] => FileMaker_Field Object
      *RECURSION*
                                                                                              )

                                                                                      )

                                                                              )

                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                      )

                                                  [_relatedSets] => Array
                                                      (
                                                          [children] => FileMaker_RelatedSet Object
                                                              (
                                                                  [_impl] => FileMaker_RelatedSet_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_Layout Object
      *RECURSION*
                                                                          [_fm] => FileMaker_Implementation Object
                                                                              (
                                                                                  [V73ee434e] => Array
                                                                                      (
                                                                                          [charset] => UTF-8
                                                                                          [locale] => en
                                                                                          [logLevel] => 3
                                                                                          [hostspec] => https://fms.charitypilot.org
                                                                                          [recordClass] => FileMaker_Record
                                                                                          [prevalidate] =>
                                                                                          [database] => db1
                                                                                          [username] => Admin
                                                                                          [password] => asdfasdfasdf
                                                                                      )

                                                                                  [Vea4b3413] =>
                                                                                  [V9a3dcbce] =>
                                                                              )

                                                                          [_name] => children
                                                                          [_fields] => Array
                                                                              (
                                                                                  [children::childID] => FileMaker_Field Object
                                                                                      (
                                                                                          [_impl] => FileMaker_Field_Implementation Object
                                                                                              (
                                                                                                  [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                                                  [_name] => children::childLast
                                                                                                  [_autoEntered] =>
                                                                                                  [_global] =>
                                                                                                  [_maxRepeat] => 1
                                                                                                  [_validationMask] => 0
                                                                                                  [_validationRules] => Array
                                                                                                      (
                                                                                                      )

                                                                                                  [_result] => text
                                                                                                  [_type] => normal
                                                                                                  [_valueList] =>
                                                                                                  [_styleType] =>
                                                                                                  [_maxCharacters] => 0
                                                                                              )

                                                                                      )

                                                                                  [children::childFirst] => FileMaker_Field Object
                                                                                      (
                                                                                          [_impl] => FileMaker_Field_Implementation Object
                                                                                              (
                                                                                                  [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                                                  [_name] => children::childLast
                                                                                                  [_autoEntered] =>
                                                                                                  [_global] =>
                                                                                                  [_maxRepeat] => 1
                                                                                                  [_validationMask] => 0
                                                                                                  [_validationRules] => Array
                                                                                                      (
                                                                                                      )

                                                                                                  [_result] => text
                                                                                                  [_type] => normal
                                                                                                  [_valueList] =>
                                                                                                  [_styleType] =>
                                                                                                  [_maxCharacters] => 0
                                                                                              )

                                                                                      )

                                                                                  [children::childLast] => FileMaker_Field Object
                                                                                      (
                                                                                          [_impl] => FileMaker_Field_Implementation Object
                                                                                              (
                                                                                                  [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                                                  [_name] => children::childLast
                                                                                                  [_autoEntered] =>
                                                                                                  [_global] =>
                                                                                                  [_maxRepeat] => 1
                                                                                                  [_validationMask] => 0
                                                                                                  [_validationRules] => Array
                                                                                                      (
                                                                                                      )

                                                                                                  [_result] => text
                                                                                                  [_type] => normal
                                                                                                  [_valueList] =>
                                                                                                  [_styleType] =>
                                                                                                  [_maxCharacters] => 0
                                                                                              )

                                                                                      )

                                                                              )

                                                                      )

                                                              )

                                                      )

                                                  [_valueLists] => Array
                                                      (
                                                      )

                                                  [Vab234ad8] => Array
                                                      (
                                                      )

                                                  [_database] => db1
                                                  [_extended] =>
                                              )

                                      )

                                  [_fm] => FileMaker_Implementation Object
                                      (
                                          [V73ee434e] => Array
                                              (
                                                  [charset] => UTF-8
                                                  [locale] => en
                                                  [logLevel] => 3
                                                  [hostspec] => https://fms.charitypilot.org
                                                  [recordClass] => FileMaker_Record
                                                  [prevalidate] =>
                                                  [database] => db1
                                                  [username] => Admin
                                                  [password] => asdfasdfasdf
                                              )

                                          [Vea4b3413] =>
                                          [V9a3dcbce] =>
                                      )

                                  [_relatedSets] => Array
                                      (
                                          [children] => Array
                                              (
                                                  [0] => FileMaker_Record Object
      *RECURSION*
                                                  [1] => FileMaker_Record Object
      *RECURSION*
                                              )

                                      )

                                  [_parent] =>
                              )

                      )

              )

      )
      FileMaker_Record Object
      (
          [_impl] => FileMaker_Record_Implementation Object
              (
                  [_fields] => Array
                      (
                          [children::childID] => Array
                              (
                                  [0] => 2
                              )

                          [children::childFirst] => Array
                              (
                                  [0] => Judy
                              )

                          [children::childLast] => Array
                              (
                                  [0] => Jetson
                              )

                      )

                  [V5e7ec2d5] => Array
                      (
                      )

                  [_recordId] => 2
                  [_modificationId] => 0
                  [_layout] => FileMaker_RelatedSet Object
                      (
                          [_impl] => FileMaker_RelatedSet_Implementation Object
                              (
                                  [_layout] => FileMaker_Layout Object
                                      (
                                          [_impl] => FileMaker_Layout_Implementation Object
                                              (
                                                  [_fm] => FileMaker_Implementation Object
                                                      (
                                                          [V73ee434e] => Array
                                                              (
                                                                  [charset] => UTF-8
                                                                  [locale] => en
                                                                  [logLevel] => 3
                                                                  [hostspec] => https://fms.charitypilot.org
                                                                  [recordClass] => FileMaker_Record
                                                                  [prevalidate] =>
                                                                  [database] => db1
                                                                  [username] => Admin
                                                                  [password] => asdfasdfasdf
                                                              )

                                                          [Vea4b3413] =>
                                                          [V9a3dcbce] =>
                                                      )

                                                  [_name] => parents
                                                  [_fields] => Array
                                                      (
                                                          [parentID] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                          [parentFirst] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                          [parentLast] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                                          [_name] => children::childLast
                                                                          [_autoEntered] =>
                                                                          [_global] =>
                                                                          [_maxRepeat] => 1
                                                                          [_validationMask] => 0
                                                                          [_validationRules] => Array
                                                                              (
                                                                              )

                                                                          [_result] => text
                                                                          [_type] => normal
                                                                          [_valueList] =>
                                                                          [_styleType] =>
                                                                          [_maxCharacters] => 0
                                                                      )

                                                              )

                                                      )

                                                  [_relatedSets] => Array
                                                      (
                                                          [children] => FileMaker_RelatedSet Object
      *RECURSION*
                                                      )

                                                  [_valueLists] => Array
                                                      (
                                                      )

                                                  [Vab234ad8] => Array
                                                      (
                                                      )

                                                  [_database] => db1
                                                  [_extended] =>
                                              )

                                      )

                                  [_fm] => FileMaker_Implementation Object
                                      (
                                          [V73ee434e] => Array
                                              (
                                                  [charset] => UTF-8
                                                  [locale] => en
                                                  [logLevel] => 3
                                                  [hostspec] => https://fms.charitypilot.org
                                                  [recordClass] => FileMaker_Record
                                                  [prevalidate] =>
                                                  [database] => db1
                                                  [username] => Admin
                                                  [password] => asdfasdfasdf
                                              )

                                          [Vea4b3413] =>
                                          [V9a3dcbce] =>
                                      )

                                  [_name] => children
                                  [_fields] => Array
                                      (
                                          [children::childID] => FileMaker_Field Object
                                              (
                                                  [_impl] => FileMaker_Field_Implementation Object
                                                      (
                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                          [_name] => children::childLast
                                                          [_autoEntered] =>
                                                          [_global] =>
                                                          [_maxRepeat] => 1
                                                          [_validationMask] => 0
                                                          [_validationRules] => Array
                                                              (
                                                              )

                                                          [_result] => text
                                                          [_type] => normal
                                                          [_valueList] =>
                                                          [_styleType] =>
                                                          [_maxCharacters] => 0
                                                      )

                                              )

                                          [children::childFirst] => FileMaker_Field Object
                                              (
                                                  [_impl] => FileMaker_Field_Implementation Object
                                                      (
                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                          [_name] => children::childLast
                                                          [_autoEntered] =>
                                                          [_global] =>
                                                          [_maxRepeat] => 1
                                                          [_validationMask] => 0
                                                          [_validationRules] => Array
                                                              (
                                                              )

                                                          [_result] => text
                                                          [_type] => normal
                                                          [_valueList] =>
                                                          [_styleType] =>
                                                          [_maxCharacters] => 0
                                                      )

                                              )

                                          [children::childLast] => FileMaker_Field Object
                                              (
                                                  [_impl] => FileMaker_Field_Implementation Object
                                                      (
                                                          [_layout] => FileMaker_RelatedSet Object
      *RECURSION*
                                                          [_name] => children::childLast
                                                          [_autoEntered] =>
                                                          [_global] =>
                                                          [_maxRepeat] => 1
                                                          [_validationMask] => 0
                                                          [_validationRules] => Array
                                                              (
                                                              )

                                                          [_result] => text
                                                          [_type] => normal
                                                          [_valueList] =>
                                                          [_styleType] =>
                                                          [_maxCharacters] => 0
                                                      )

                                              )

                                      )

                              )

                      )

                  [_fm] => FileMaker_Implementation Object
                      (
                          [V73ee434e] => Array
                              (
                                  [charset] => UTF-8
                                  [locale] => en
                                  [logLevel] => 3
                                  [hostspec] => https://fms.charitypilot.org
                                  [recordClass] => FileMaker_Record
                                  [prevalidate] =>
                                  [database] => db1
                                  [username] => Admin
                                  [password] => asdfasdfasdf
                              )

                          [Vea4b3413] =>
                          [V9a3dcbce] =>
                      )

                  [_relatedSets] => Array
                      (
                      )

                  [_parent] => FileMaker_Record Object
                      (
                          [_impl] => FileMaker_Record_Implementation Object
                              (
                                  [_fields] => Array
                                      (
                                          [parentID] => Array
                                              (
                                                  [0] => 1
                                              )

                                          [parentFirst] => Array
                                              (
                                                  [0] => George
                                              )

                                          [parentLast] => Array
                                              (
                                                  [0] => Jetson
                                              )

                                      )

                                  [V5e7ec2d5] => Array
                                      (
                                      )

                                  [_recordId] => 1
                                  [_modificationId] => 0
                                  [_layout] => FileMaker_Layout Object
                                      (
                                          [_impl] => FileMaker_Layout_Implementation Object
                                              (
                                                  [_fm] => FileMaker_Implementation Object
                                                      (
                                                          [V73ee434e] => Array
                                                              (
                                                                  [charset] => UTF-8
                                                                  [locale] => en
                                                                  [logLevel] => 3
                                                                  [hostspec] => https://fms.charitypilot.org
                                                                  [recordClass] => FileMaker_Record
                                                                  [prevalidate] =>
                                                                  [database] => db1
                                                                  [username] => Admin
                                                                  [password] => asdfasdfasdf
                                                              )

                                                          [Vea4b3413] =>
                                                          [V9a3dcbce] =>
                                                      )

                                                  [_name] => parents
                                                  [_fields] => Array
                                                      (
                                                          [parentID] => FileMaker_Field Object
                                                              (
                                                                  [_impl] => FileMaker_Field_Implementation Object
                                                                      (
                                                                          [_layout] => FileMaker_RelatedSet Object
                                                                              (
                                                                                  [_impl] => FileMaker_RelatedSet_Implementation Object
                                                                                      (
                                                                                          [_layout] => FileMaker_Layout Object
      *RECURSION*
                                                                                          [_fm] => FileMaker_Implementation Object
                                                                                              (
                                                                                                  [V73ee434e] => Array
                                                                                                      (
                                                                                                          [charset] => UTF-8
                                                                                                          [locale] => en
                                                                                                          [logLevel] => 3
                                                                                                          [hostspec] => https://fms.charitypilot.org
                                                                                                          [recordClass] => FileMaker_Record
                                                                                                          [prevalidate] =>
                                                                                                          [database] => db1
                                                                                                          [username] => Admin
                                                                                                          [password] => asdfasdfasdf
                                                                                                      )

                                                                                                  [Vea4b3413] =>
                                                                                                  [V9a3dcbce] =>
                                                                                              )

                                                                                          [_name] => children

        • 1. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()

          Cody: 

           

          Thank you for the post.

           

          I don’t have a Yosemite machine for testing right at this moment, but I wanted to let you know that in both a single machine deployment and a two machine deployment on Mac OS X 10.8.5 your code works as expected. The query returns both Judy Jetson and Elroy Jetson.  

           

          Once I have an opportunity to test Yosemite, I will post again. 

           

          TSFalcon

          FileMaker, Inc.

          • 2. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()

            Cody: 

             

            I got access to a Mac OS X 10.10.2 Yosemite computer for testing. The initial installation’s operating system was upgraded from 10.9.5 to 10.10.2 and we did encounter issues. Afterwards, we did a wipe of the hard drive followed by a clean install of Mac OS X 10.10.2, then installed FileMaker Server 13.0v5 and your code worked as expected. 

             

            TSFalcon

            FileMaker, Inc.

            • 3. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()
              millennium

              Dear TSFalcon,

              Can you confirm correct behavior on a single machine deployment (which we have serving native FM and WebDirect) as well as a separate PHP/web server accessing that same database?

              If you would like, you can give me the server address for your FMS and I can test the PHP code from our PHP/web server.  I'd like to know that in this configuration there is correct behavior before I rebuild and recertify a production server.

              Thanks,

              Cody

              • 4. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()

                Cody: 

                 

                Thank you for the reply.

                 

                “Can you confirm correct behavior on a single machine deployment (which we have serving native FM and WebDirect) as well as a separate PHP/web server accessing that same database?”

                 

                Both a single machine deployment and a two machine deployment were tested and both were successful. 

                 

                However, this test was on an Intranet setup, so no test link is publicly available. 

                 

                The only change made to your original code was changing the domain name to “localhost.” Since this worked, if you continuing to experience issues, then look to the operating system or network configuration as the source of the problem.

                 

                TSFalcon

                FileMaker, Inc.

                • 5. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()
                  millennium

                  Dear TSFalcon,

                  Since it is on an intranet, can you confirm correct behavior with a single machine deployment, but with a separate webserver (not a dual machine deployment) making PHP calls to the FileMaker server?  You could even do this using MAMP/WAMP with our code and change the domain name to the IP address of your FMS on the intranet.

                  Thank You,

                  Cody

                  • 6. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()
                    millennium

                    For what it is worth, when we run our PHP files on a WAMP server on our intranet, we also get the same (last) record values.  I will test on a separate FMS server on a separate LAN to confirm if it is the OS/FMS installation that is the problem or if it is the use of a cloud-based PHP/web server calling the FMS.

                    • 7. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()

                      Cody:

                       

                      Thank you for the replies.

                       

                      “can you confirm correct behavior with a single machine deployment, but with a separate webserver (not a dual machine deployment) making PHP calls to the FileMaker server?”

                       

                      We were able to run this test this morning and the correct results were returned.

                       

                      “I will test on a separate FMS server on a separate LAN to confirm if it is the OS/FMS installation that is the problem or if it is the use of a cloud-based PHP/web server calling the FMS.”

                       

                      I agree this sounds like the best way to proceed forward. Please keep me updated with any progress. 

                       

                      TSFalcon

                      FileMaker, Inc.

                      • 8. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()
                        millennium

                        Dear TS Falcon,

                        I installed a new Mac Mini running Yosemite 10.10.2 and ran all updates.  I installed a trial of FileMaker Server 13.0.5.520.  I did a single machine deployment and selected the following:

                        No, do not enable ODBC/JDBC
                        Yes, enable web publishing
                        X PHP
                        No, use my existing installation of the PHP engine

                        The Deployment Summary was a follows:

                        FileMaker Server Name  M-6
                        ODBC/JDBC  Disabled
                        Web Server  Enabled
                        FileMaker WebDirect  Disabled
                        XML  Disabled
                        PHP  Enabled
                        Web Publishing  Enabled

                        The Deployment Results were all "succeeded".  I opened the CWPtest.fmp12 file contained in this zip file: http://charitypilot.org/CWPtest.zip and uploaded it to the FMS and opened it on the server.  I loaded the PHP files contained in the zip onto my local machine running WAMP.  I edited the server to "M-6" or "192.168.1.93" testing both server addresses with success, but the CWPtest02.php file returns the following:

                        Favorite Color of people like Charles

                        We searched for Charles and found related people and their favorite colors.

                        Set Name: All_People.

                        We found Ted's favorite color to be Red.

                        We found Ted's favorite color to be Red.

                        We found Ted's favorite color to be Red

                        Again, it is three occurrences of the same (last) record.  Note that this database and PHP files were provided to me by Susan Murphy of FileMaker Customer Support to illustrate the correct usage of getRelatedSet.  Can you duplicate the steps I performed above and confirm that you are able to get all related records and not simply the last record?

                        • 9. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()

                          Cody:

                           

                          Thank you for testing.

                           

                          “I installed a new Mac Mini running Yosemite 10.10.2 and ran all updates.”

                           

                          Does this mean the computer came with Yosemite pre-installed? If another operating system was on the computer prior, did you perform an erase and install?

                           

                          “No, use my existing installation of the PHP engine”

                           

                          This is not what we tested. Could you perform the same test using our version of PHP?

                           

                          “Can you duplicate the steps I performed above and confirm that you are able to get all related records and not simply the last record?”

                           

                          We will test using the operating system’s version of PHP and let you know the results. 

                           

                          TSFalcon

                          FileMaker, Inc.

                          • 10. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()
                            millennium

                            Dear TSFalcon,

                            Yes the Mac came with Yosemite.

                            We aren't using PHP or the webserver on the Mac.  We are running PHP on a webserver in the cloud which is attaching to the database which is running on our Mac.

                            "Could you perform the same test using our version of PHP?"

                            We cannot use FileMaker's version of PHP because we need to distribute our PHP files across many servers around the world.  These will all authenticate to the FM database running here on our FMS.

                            For what it is worth, I signed up for a trial account with a FileMaker hosting provider, uploaded the CWPtest.fmp12 database and pointed our PHP files to that server with the same erroneous results.  You can do this by uploading the CWPtest02.php file onto any webserver running PHP and change the server to n324.fmphost.com

                            Any ideas what is going on?

                            • 11. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()

                              Cody:

                               

                              I was able to do some more testing. We were able to test FileMaker Server 13.0v5 using the operating system’s version of PHP with your code and everything worked correctly.

                               

                              At this point, since this continues to not work on your end, the issue appears to be isolated to the host environment. 

                               

                              TSFalcon

                              FileMaker, Inc.

                              • 12. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()
                                millennium

                                Dear TSFalcon,

                                I have confirmed that the CWPtest02.php file contained in the zip above does work when placed in the htdocs folder on the Mac FMS with PHP installed.

                                Does this mean that one cannot consistently access a FileMaker database through the PHP API from a separate or multiple PHP/web servers?  We can obviously perform finds and retrieve records, but not related records.  Is this by design or a bug?

                                Have you reproduced the configuration and results I described in the 9:42am post above?

                                • 13. Re: PHP API Fails to Return Multiple Records Using getRelatedSet()

                                  Cody:

                                   

                                  After further testing, we were able to identify the problem. We did test with your code from the link provided above and with the web server hosted on n324.fmphost.com. Your original code does not return the related records like when you tested. 

                                   

                                  Afterwards, I deleted the FileMaker.PHP file and the FileMaker folder leaving the rest of the original code intact and replaced the deleted files with a newer version of the files from the extracted zip folder FM_API_for_PHP_Standalone. 

                                   

                                  The query appears to be breaking because the PHP files were from an older version of FileMaker Server. Replace those with the newest versions of the same files and let me know if your test now works successfully. 

                                   

                                  Let me know if any of the above requires further clarification. 

                                   

                                  TSFalcon

                                  FileMaker, Inc.