[FX.php List] Setting a global field in IWP using FX.PHP

Chris Hansen chris at iViking.org
Fri Apr 21 10:01:33 MDT 2006


At issue here is the fact that global fields are set on a per  
connection basis, and in the case of XML (as used by FX.php) only  
last for the duration of the current query.  In other words, no other  
user would see any change to their globals.  If you want to track  
information like this, use PHP sessions.  If multiple users need to  
have access to a single value in FileMaker, consider using a one  
record table with the shared value in a normal field (i.e. not a  
global.)  HTH

Chris Hansen
Application Developer
The Moyer Group
chansen at moyergroup.com
Creator of FX.php
"The best way from FileMaker to the Web."
FileMaker 7 Certified Developer

On Apr 20, 2006, at 5:17 PM, Lostpants wrote:

> I'm trying to use FX to set a global field in an IWP database.
> The 'SetFMGlobal' function doesn't seem to work, and I am not  
> getting back
> any errors back.
> I have read that you have to include session information somewhere  
> in order
> to populate a global, but don't see any reference to session info  
> in the
> function reference.
> Here is the page that tries to put, 'hello' into my gloabal field.
> BTW: the commented line is an experiment to try the adddbparam  
> function. It
> too didn't work.
> <html>
> <head>
> <title>Updating a variable using fxPHP</title>
> <meta http-equiv="Content-Type" content="text/html;  
> charset=iso-8859-1">
> </head>
> <body>
> <p>This script attemtps to update a global variable in FMPro8 Server
> Advanced using<br>
> the AddDBParam, SetFMGlobal and FMFind method from fxPHP.</p>
> <?
> require_once($_SERVER['DOCUMENT_ROOT']."/FX/FX.php");
> require_once($_SERVER['DOCUMENT_ROOT']."/FX/FX_Error.php");
> require_once($_SERVER['DOCUMENT_ROOT']."/FX/server_data.php");
> require_once($_SERVER['DOCUMENT_ROOT']."/FX/FX_constants.php");
> $myQuery=new FX('',80,'FMPro7');
> $myQuery->SetDBData('PMRT.fp7','Login');
> $myQuery->SetDBPassword('Guest','');
> //$myQuery->AddDBParam('-recid',$id);
> $myQuery->AddDBParam('gLogin_email','hello');
> $myQuery->SetFMGlobal('gLogin_email','hello');
> $myQueryResult=$myQuery->FMFind();
> if($myQueryResult['errorCode']==0){
> echo "Database update check: GOOD<br>";
> echo "<script>window.opener.location.reload()</script>";
> }else{
> echo "<font color=\"red\">Database update check: BAD</font><br>";
> echo $myQueryResult['errorCode'];
> }
> ?>
> </body>
> </html>
> _______________________________________________
> 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