[FX.php List] Display a Rlated list of records

Andy Gaunt andy at fmpug.com
Fri Oct 13 09:34:54 MDT 2006


Gerry,

 

Your portal data is in its own array within the FX array at large.

 

The records begin with zero and count up.

 

This means you can use a simple for loop to display the portal data as and
when it is needed. All you need is a field that contains data for each row
(like the record serial number)

 

You can also check if the portal contains data using a count function.

 

Try this;

 

//FieldA in this example must contain data for the record (eg a required
field such as an incremental serial number

$countPortal = count ($value['YOURRELATIONSHIP::FieldA']);

if $countPortal >0) {

for($counter=0; $counter < count($value['YOURRELATIONSHIP::FieldA']);
$counter++) {

            //display your portal data here

            //Just remember instead of using the trailing zero you now use
$counter

            // e.g.  echo $value['YOURRELATIONSHIP::FieldA'][$counter];

}

}

 

HTH

 

Andy Gaunt

Office: 321.206.3658

Mobile: 407.810.4722

andy at fmpug.com

http://www.fmpug.com    

 

2006 FileMaker Excellence Award Winner

Recipient of FileMaker's 2005 "Mad Dog" Public Relations Award

 

For chapter locations, dates & times please visit the website at
http://www.fmpug.com If you can make it to a meeting, please RSVP at
http://www.fmpug.com/rsvp.php

 

  _____  

From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of
gerry.charest at agfa.com
Sent: Thursday, October 12, 2006 2:25 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] Display a Rlated list of records

 

Hi All,

I'm having a brain cramp today, perhaps some one can help me out.

I have a list of records that each may have a group of related values
returned from a portal. What I would like to do is display the portal data
in a table, following the parent record data. When the portal has records it
is visible when it doesn't it is not shown. I'm assuming I would use a
foreach loop to display the portal records and corresponding html. But I
just can't get my head around defining the foreach loop to iterate for the
number of related records from the portal. Can someone give me a nudge with
the MISSING SYNTAX? 


foreach ($searchResult['data'] as $key=>$searchData){
//Parent Record Data display here
foreach( "MISSING SYNTAX" ){
//Child record data displayed here
}
}


Thanks
Gerry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20061013/c10369b8/attachment.html


More information about the FX.php_List mailing list