[FX.php List] FX issue moving FMServer 11 to FMServer 12

SmilePix sam at smilepix.com
Sun Mar 1 13:27:46 MST 2015


Finally bitting the bullet and converting my old fp7 database to fmp12. I have been using fx.php for at least 10 years with my present database and it has worked fine. I am finding a glitch in being able to do the first find which is a result of a client logging into the database.

Here is what worked on FMSever 11 (there is a portal on the page):

<?php
if(!isset($_REQUEST['dr_id']) || $_REQUEST['dr_id'] == "")
	{
	header("Location: nologin.html");
	exit();
	};
session_start();
include_once($_SERVER['DOCUMENT_ROOT'] . "/FX/FX.php");
include_once($_SERVER['DOCUMENT_ROOT'] . "/FX/FX_Error.php");
include_once($_SERVER['DOCUMENT_ROOT'] . "/FX/server_data.php");


$dr_id = $_REQUEST['dr_id'];

$groupSize='20';
$skip = 0;
if(isset($_GET['skip']))
	{ $skip = $_GET['skip']; }
else
	{ $skip = 0;};

$search=new FX($serverIP,$webCompanionPort,'FMPro7');
$search->SetDBData('SmilePix.fp7','cases_php',$groupSize);
$search->SetDBPassword(‘...’,’...');
$search->AddDBParam('dr_id',$dr_id);
$search->AddSortParam('pat_id','descend');
$search->FMSkipRecords($skip);
$searchResult=$search->FMFind();

$searchDataKeys = array_keys($searchResult['data']);
$searchData = $searchResult['data'][$searchDataKeys[0]];


$_SESSION['DrId']=$searchData['dr_id'][0];
$_SESSION['web_title']=$searchData['web_title'][0];
$_SESSION['email']=$searchData['email'][0];

$balance = number_format($searchData['balance'][0],2);

?>

On FMServer 13 I am getting an error at this point:

line 30	$searchDataKeys = array_keys($searchResult['data']);
line 31	$searchData = $searchResult['data'][$searchDataKeys[0]];

Fatal error: Cannot use object of type FX_Error as array in /home/smilep6/public_html/client3/home.php on line 30

I have searched around, but can not figure out why it works on FM 11 and not FM 13. I have the latest version of fx.php (6.0).

Thanks in advance for your help - Sam


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20150301/5b07e377/attachment.html


More information about the FX.php_List mailing list