[FX.php List] Displaying related records

Tim 'Webko' Booth tim at nicheit.com.au
Mon Jul 21 20:32:41 MDT 2008


On 22/07/2008, at 12:24 PM, Bob Patin/Longterm Solutions wrote:

> Here's how I'd write it:
>
> foreach($searchResult['data'] as $key => $value) {
> 	echo  $value['off_FEATURE::Headline'][0];
> }
>
> You don't need that internal FOREACH.

Won't that only get you the first related record for each parent  
record??

If you really want to use a portal for this, knowing how many lines  
there is useful, then you can:

for($i=0; $i<$lineitemCount; $i++) {
	echo $value['off_FEATURE::Headline'][$i];
}

(Written of the top of my head - that $i = 0 might have to be -1  
maybe...)
Cheers

Webko


More information about the FX.php_List mailing list