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

Jonathan Schwartz jschwartz at exit445.com
Mon Dec 17 21:09:54 MST 2007


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


More information about the FX.php_List mailing list