2 Replies Latest reply on Nov 11, 2011 1:48 AM by Polarpro

    PHP and setField




      In my PHP script I use some steps to edit a field in my FileMaker database. Everything works fine but writing into this filed. Here is the part of the code that does not work:



      $insert = $fm->newEditCommand('PHP_Layout', $_REQUEST['id']);

      $insert->setField('Url', $url);




      The field Url is on the PHP_Layout layout. The variable $url contains an existing value. I checked also if there is really a record id; everything is ok.

      Furthermore, I checked if I am allowed to edit the record in the accounts and privileges of the Filemaker file, this seems to be ok, too (as I use the Admin account in this case).


      Is there anything else that needs to be taken care of when trying to edit a record via PHP?


      Thanks a lot,


        • 1. Re: PHP and setField

          Try doing


                  $result = $insert->execute();



          ...and see if there's anything informative in the result object.

          1 of 1 people found this helpful
          • 2. Re: PHP and setField

            Hey Rob,


            Thanks for your hint. After analysing $result I found PEAR error 200; FielMaker error 200 would be "Record access is denied". So, I checked again my accounts and privileges, and found that editing the records of this table was allowed (as mentioned above), but not editing them via the layout that I use to access my FileMaker database. So, things work fine now.


            Thank you very much for pointing out this way of getting information of what is going on.