[FX.php List] Portal vs 2nd query [Was: Related Records]
Joel Shapiro
jsfmp at earthlink.net
Mon Mar 20 13:36:19 MST 2006
Hi all
I've often wondered which produces better performance (or is better
design):
a) Having a relationship in FileMaker and viewing related records
through the portal (and code similar to Derrick's below),
or
b) Keeping the FM tables as 'raw data' and querying the related
records through PHP after first querying the 'parent' record.
I have one page in a project with multiple 'nested' queries, since
you can't have portals within portals, but when it's just a matter of
multiple children to one parent, how does the 2nd query balance
against the FM relationship - performance/stability-wise?
Any thoughts or words of wisdom?
TIA,
-Joel
Joel Shapiro - FileMaker Pro Database Design
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
joelshapiro at jsfmp dot com
http://www.jsfmp.com
415-269-5055
On Mar 20, 2006, at 8:28 AM, Derrick Fogle wrote:
> If you want it to be similar to an FM portal, then use the portal.
> The last array element in any FX field reference indicates it's
> repeating field number or portal row number. You only need a single
> database query, and will get all the data on the referenced layout.
> Here's a sample of the code I use:
>
> $prow = 0;
> while($value['Relationshipname::ID_Field'][$prow]) {
> echo $value['Relationshipname::Data_Field'][$prow];
> echo "<br />";
> $prow++;
> }
>
> Salt to taste...
More information about the FX.php_List
mailing list