[FX.php List] FX issue moving FMServer 11 to FMServer 12
Ness, David
dness at bondedbuilders.com
Mon Mar 2 12:12:29 MST 2015
I rarely know what I'm talking about, but I won't let that from keeping me from responding...
In my attempt to switch from FM7 to FM12/13, I had to change all of my "new FX" statements to include all 4 parameters as shown.
Because I haven't yet eliminated my use of related field values, I still have to use "fmalt" as the $datasourcetype instead of "FMPro7". One day I'll fix this into separate related table queries to improve performance.
My $scheme is set to "http", but yours may be "https" if you're using SSL connections.
$search=new FX( $serverIP, $webCompanionPort, $dataSourceType, $scheme );
David Ness
FileMaker & Web Applications Developer
Bonded Builders Warranty Group
St. Petersburg, Florida USA
800-749-0381 x4923
From: fx.php_list-bounces at mail.iviking.org [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of SmilePix
Sent: Sunday, March 01, 2015 3:28 PM
To: fx.php_list at mail.iviking.org
Subject: [FX.php List] FX issue moving FMServer 11 to FMServer 12
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/20150302/01043e1a/attachment-0001.html
More information about the FX.php_List
mailing list