[FX.php List] FX_Error in iis only

Andrew Denman adenman at tmea.org
Fri Jul 10 15:25:37 MDT 2009


A little tidbit I gleaned off this list sometime last year...  FX.php includes a function to check if the returned result is an FX_Error object. Note that this does not check for FileMaker errors.

If(FX::isError($result)){yes, FX_Error}else{no, keep going}

Andrew Denman

From: fx.php_list-bounces at mail.iviking.org [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Dale Bengston
Sent: Friday, July 10, 2009 1:53 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] FX_Error in iis only

Yes, if your code generates an FX error, $result is a PHP object, not a PHP array. I use the built-in PHP function is_object() to trap this scenario.

Dale


On Jul 10, 2009, at 1:33 PM, Leo R. Lundgren wrote:



10 jul 2009 kl. 19.54 skrev John Funk:


$result =$request->FMFind();
$records =$result['data'];

the $result you get back from $request->FMFind() is an instance of the class FX_Error, and the problem is that you're not checking for this but presuming that the result is not an error, and you try to use it as an array in the second line.

As Jonathan said, implement error checking. I'm sure the appropriate code is described in the FX documentation :)

-|

_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org<mailto:FX.php_List at mail.iviking.org>
http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20090710/8183eaf2/attachment.html


More information about the FX.php_List mailing list