[FX.php List] testing connection to database

Andy Gaunt andy at fmpug.com
Thu Mar 29 09:06:07 MDT 2007


Speaking of FileMaker servers not responding, you may want 
to check out this great new server monitoring tool by 
Crooked Arm (http://www.crookedarm.com/gladys.html)

Gladys keeps an eye on your servers and can send email or 
text messages, display messages and even run applescripts 
if;

The server is not available
A file is not available
An account logs in or out.

And as a quick plug, FMPug members save 20% off the 
standard and pro versions.

All the best

Andy

On Thu, 29 Mar 2007 09:36:23 -0500
  "Andrew Denman" <adenman at tmea.org> wrote:
> As far as I can tell, when FX.php fails (ie: no 
>connection to the database)
> it does not return an array; it returns an FX_Error 
>object with debug
> information.  This is what I use to check if a command 
>has gone through
> successfully:
> 
> if(!is_array($ReturnData) || $ReturnData['errorCode'] != 
>0) {
> //error message
> }
> 
> Andrew Denman
> 
> -----Original Message-----
>From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf 
>Of Alex Gates
> Sent: Thursday, March 29, 2007 9:11 AM
> To: 'FX.php Discussion List'
> Subject: RE: [FX.php List] testing connection to 
>database
> 
> Thanks, ggt - 
> I changed it to
> 
> $testfindResult=$testfind->FMView();
> 
> but I still get the error: Cannot use object of type 
>FX_Error as
> array... error instead of an error code.
> 
> I can, however, see how using FMView() would lighten the 
>load compared
> to FMFindAny
> 
> Alex 
> 
> 
> -----Original Message-----
>From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf 
>Of Gjermund
> Gusland Thorsen
> Sent: Thursday, March 29, 2007 9:00 AM
> To: FX.php Discussion List
> Subject: Re: [FX.php List] testing connection to 
>database
> 
>FMView()
> 
> On 3/29/07, Alex Gates <alex at gandrpublishing.com> wrote:
>> Hi everyone-
>>
>> What methods are you using to test the connection to the 
>>database?
>>
>>
>> I'm trying this:
>>
>>
>> include_once('FX/FX.php');
>> include_once('FX/server_data.php');
>> include_once('FX/FX_Error.php');
>>
>>
>> $testfind=new FX($serverIP, $webCompanionPort, 
>>'FMPro7');
>> $testfind->SetDBData('filename.fp7','layoutname');
>> $testfind->SetDBPassword('xxxxx','xxxxx');
>> $testfindResult=$testfind->FMFindany();
>> echo $testfindResult['errorCode'];
>>
>>
>>
>> We had our FileMaker server go down this morning and I 
>>realized that I
>> didn't have any tests to the server.
>>
>> I'd ultimately like to say
>> if($testfindResult['errorCode'] != 0) {
>>
>> Send email to my mobile phone because there is a 
>>critical problem with
>> the server.
>>
>> }
>>
>>
>> But instead of getting an error code, I get:
>>
>> Fatal error: Cannot use object of type FX_Error as 
>>array...
>>
>> Am I missing something simple?
>>
>> Alex
>>
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
> _______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> 
> 
> _______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list