[FX.php List] Related Data on a second server

Steve Winter steve at bluecrocodile.co.nz
Fri Jun 1 02:13:33 MDT 2012


Hi Stephe

include_once("FX/FX.php");
include_once("FX/server_data.php");
include_once("FX/FMErrors.php");

$resourceId=$_REQUEST['resourceId'];
$resourceType=$_REQUEST['resourceType'];

$comments=new FX($serverIPONE, $webCompanionPort,'FMPro7');

$comments->setDBData('Precedents.fp7','comment_web','1000');
$comments->SetDBUserPass ($webUN, $webPW); 

$comments->AddDBParam('Comment::resource_id',$resourceId);
$commentsResult=$comments->FMFind();

$otherComments=new FX($serverIPTWO, $webCompanionPort,'FMPro7');

$otherComments->setDBData('Precedents.fp7','comment_web','1000');
$otherComments->SetDBUserPass ($webUN, $webPW); 

$otherComments->AddDBParam('Comment::resource_id',$resourceId);
$otherCommentsResult=$otherComments->FMFind();


You now have two results, one from each of two servers and can process them with PHP as you see fit. I would advise against doing an array_merge of the two results sets, since it's quite possible that the FM allocated -recid values could of two records from each machine could be the same…

I've done this several times in the past, even (in the olden days) pulling data from FM6 and FM8 for display in the same web page…

HTH

Cheers
Steve

> {bump} does anyone have data being displayed from two Filemaker servers?  If so, how do you do it.
> 
> Thanks
> 
> Stephe
> 
> From: Stephe Pocock <zippyaus at yahoo.com>
> To: FX.php Discussion List <fx.php_list at mail.iviking.org> 
> Sent: Monday, 28 May 2012 4:47 PM
> Subject: [FX.php List] Related Data on a second server
> 
> Hi all
> 
> For performance and dependability reasons we have two Filemaker servers.
> 
> On server one I have a comments database and on server two I have a contacts database.
> 
> Comments display the related contact in Filemaker without and issue.
> 
> If I try and display the contact details in the results returned on the comments database, I don't get a result.
> 
> Is this possible using FX.php?
> 
> I am trying to get the full name to return from the contacts database. <?php echo $comment['Comment_StaffContact::FullName'][0];?> 
> 
> Full code below.
> 
> Any help would be greatly appreciated.
> 
> Regards
> 
> Stephen
> 
> 
> <?php
> include_once("FX/FX.php");
> 
> include_once("FX/server_data.php");
> include_once("FX/FMErrors.php");
> 
> $resourceId=$_REQUEST['resourceId'];
> $resourceType=$_REQUEST['resourceType'];
> 
> $comments=new FX($serverIP,$webCompanionPort,'FMPro7');
> 
> $comments->setDBData('Precedents.fp7','comment_web','1000');
> $comments->SetDBUserPass ($webUN, $webPW); 
> 
> $comments->AddDBParam('Comment::resource_id',$resourceId);
> $commentsResult=$comments->FMFind();
> //foreach ($commentsResult['data'] as $key => $comment)
> 
> ?>
> <?php
> if($commentsResult['foundCount'] == 0){
> echo 'resource id';
> include_once("includes/error.php");
> }
> else{?>
> <html>
> <head>
> <title>Precedents</title>
> </head>
> <body>
>     <div id="primary_content">
>             <ul class="comments">
>                 <?php foreach ($commentsResult['data'] as $key => $comment) { ?>
>                 <li>
>                     <div><span class="comment_name"><?php echo $comment['Comment_StaffContact::FullName'][0];?> </span> <?php echo $comment['comment_text'][0];?> </div>
>                 </li>
>                 <?php } ?>
>             </ul>
>     </div>
> </body>
> </html>
> <?php } ?>
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

Steve Winter
+44 777 852 4776
steve at bluecrocodile.co.nz



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20120601/2acb985e/attachment.html


More information about the FX.php_List mailing list