November 22, 200421 yr I am using PHP 4.3.9and running the following simple code:- <?php if( !isset($_SERVER['PATH_TRANSLATED']) ) { if(isset($_SERVER['SCRIPT_FILENAME'])) $_SERVER['PATH_TRANSLATED'] =$_SERVER['SCRIPT_FILENAME']; else $_SERVER['PATH_TRANSLATED'] =realpath('install.php'); } if (! isset($_SERVER['DOCUMENT_ROOT'])) { global $DOCUMENT_ROOT; global $HTTP_SERVER_VARS; $_SERVER['DOCUMENT_ROOT'] = str_replace(str_replace('', '/', $_SERVER['PHP_SELF']), '', str_replace('', '/', $_SERVER['PATH_TRANSLATED'])) . '/'; $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT']; } include_once("/inetpub/wwwroot/FX7/FX.php"); include_once("/inetpub/wwwroot/FX7/server_data.php"); $serverIPAddress = '127.0.0.1'; $InstanceName = new FX($serverIPAddress,80); $ReturnedData = $InstanceName->FMDBNames(); // stores layout information in $ReturnedData echo "<b>Databases Open on $serverIPAddress </b><br />n"; foreach ($ReturnedData['data'] as $value) { echo $value['DATABASE_NAME'][0] . "<br />n"; } ?> But it is giving me following error: Warning: Cannot use a scalar value as an array in C:InetpubwwwrootBuddysystesttest5.php on line 31 Warning: Invalid argument supplied for foreach() in C:InetpubwwwrootBuddysystesttest5.php on line 31 Plz help me out to get rid of this error.
November 22, 200421 yr I suggest 2 things. 1 - Don't migrate to PHP 5.x yet. I ran into all kinds of problems on Win2003 Server/IIS6. See http://www.fmforums.com/threads/showflat.php?Cat=&Board=php&Number=129612 2 - Comment out $instanceName->SetDBUserPass('',''); OR set up an account and declare the u/p here. Hope this helps, Shannon
Create an account or sign in to comment