[FX.php List] [OT] Planning for/handling Server Outage

Gjermund Gusland Thorsen ggt667 at gmail.com
Wed Dec 19 02:46:33 MST 2007


Never under estimate the power of such a constellation when making a
log using FMNew()

$q->AddDBParam( 'server', var_export( $_SERVER, true ) );
$q->AddDBParam( 'previousFMQuery', var_export( $r, true ) );
$q->AddDBParam( 'post', var_export( $_POST, true ) );
$q->AddDBParam( 'get', var_export( $_GET, true ) );

This might be considered a little bit nazi-like-logging, but who cares???,
at least you got your back covered for when it starts raining.

And please do that log a separate file and not just a table in your
solution; size will increase.

Gjermund

2007/12/18, Jonathan Schwartz <jschwartz at exit445.com>:
> I figured this one out...but don't know why.
>
> In_Array () wants a "pure" array ('red','blue','green', etc) and not
> the $findResult. In order to make it work, I had to use a foreach and
> array_push (It's the only way I know) to create a an array
> conataining he db names. Then I used in_array.
>
> I'm sure that there is a better way. ;-)
>
> Jonathan
>
>
> At 1:25 PM -0800 12/17/07, Jonathan Schwartz wrote:
> >Instead of using FMView(), I just tried FMPDBNames().
> >
> >While it does list open DB's, I can't seem to get the boolean to
> >work to test for the error:
> >
> ><
> >       include_once('../FX/FX.php');
> >       include_once('../FX/FX_Error.php');
> >       include_once('../FX/server_data.php');
> >
> >
> >       $find = new FX($serverIP);
> >       $findResult = $find->FMDBNames();
> >
> >       echo "Foundcount: ".$findResult['foundCount'];
> >       echo "Error Code: ".$findResult['errorCode'];
> >
> >       if(in_array("DesiredDatabaseName",$findResult))
> >       {
> >       echo "OK";
> >       }else{
> >       echo "Fail";
> >       }
> >       foreach($findResult['data'] as $value)
> >        echo $value['DATABASE_NAME'][0].'<br>';
> >
> >
> >This produces a list of the databases, but the If statement returns
> >"Fail" when I use the in_array function, although the db appears in
> >the list.  I also tried $findResult['data'] with no difference.
> >
> >What am I doing wrong?
> >
> >J
> >
> >At 10:33 AM -0600 12/17/07, Alex Gates wrote:
> >>Hi Jonathan -
> >>...I first do a quick fmview() to test connectivity to the database.
> >
> >--
> >Jonathan Schwartz
> >Exit 445 Group
> >jonathan at exit445.com
> >http://www.exit445.com
> >415-381-1852
> >_______________________________________________
> >FX.php_List mailing list
> >FX.php_List at mail.iviking.org
> >http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> --
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-381-1852
> _______________________________________________
> 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