[FX.php List] Displaying related records

Bob Patin/Longterm Solutions bob at patin.com
Mon Jul 21 21:04:05 MDT 2008


Of course you're right, I wasn't thinking.

I agree with Tim though; I'd go to the related table. I never put  
portals on web layouts; instead, as he said, I go to the related  
table, pull the other records... which explains why I didn't remember  
I had to use nested FOREACHes.

BP


On Jul 21, 2008, at 9:51 PM, Jonathan Schwartz wrote:

> Do believe that you are right.
>
> Any way, I just thought that I was missing the boat by issuing two  
> separate queries instead of using the single query.
>
> Guess not.
>
> I'm going back to the multiple query method.  It's a sure thing.
>
> Thanks
>
> Jonathan
>
> At 12:32 PM +1000 7/22/08, Tim 'Webko' Booth wrote:
>> 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
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> -- 
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-370-5011
> _______________________________________________
> 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