1 Reply Latest reply on Oct 6, 2016 7:32 PM by user19752

    Set Variable not returning a value when the script is run by PHP?

    deninger

      Okay,

       

      Maybe I am seeing clowns on the corners, or something else entirely, but I am rather confused by the following scenario:

       

      A script runs properly from FM Pro and even if run as a PSOS.

       

      When I use PHP to kick off a script, sometimes strange things happen, and it always appears originate with a Set Variable step.

       

      Consider this example:

       

      Set Variable [ $nonGPImedList ; Value:

           Let (

                [

                   sql = "SELECT DISTINCT (\"dispensedProduct.productName\") FROM rxFillList WHERE globalPatientID = ? AND GPI_GROUP_CODE ='00' AND GPI_CLASS_CODE='00' AND GPI_SUBCLASS_CODE = '00' AND GPI_NAME_CODE = '00' "    

                ];

       

                 ExecuteSQL (sql ; "" ; "" ; $patientID)

            )

      ]

      The logged value is REAL (zero or more) when run in FM Pro

       

      When run from the following PHP code:

       

      <?php

      error_reporting(E_ALL | E_STRICT);

      //ini_set('display_errors', '1');

       

      define('fm_host', '***.***.***');

      define('fm_file', 'myDBFile');

      define('fm_user', '********');

      define('fm_pass', '********');

      $layout_name = 'myLayout';

       

      require ('FileMaker.php');

       

      $param = file_get_contents('php://input');

       

       

      $fm = new FileMaker(fm_file, fm_host, fm_user, fm_pass);

      $script = $fm->newperformscriptcommand('myLayout' , 'manageProfile (globalPatientID)' , $param );

      $result = $script->execute();

      ...

       

      The logged result is ?

       

      Any idea what is happening? Has anyone else observed this?