[FX.php List] Showing last related record - sort in FM or just PHP?
Joel Shapiro
jsfmp at earthlink.net
Mon Oct 16 16:22:05 MDT 2006
Hi all
I need to pull the last (most recent) related record for each of a
set of found records. I'm wondering about the best / most efficient
way to do this.
(a)
- create a relationship in FM that sorts in reverse order,
- place related fields on web layout -- No portal
(b)
- create a relationship in FM w/ no sort order,
- place portal (w/ fields) on web layout,
- in php, don't use foreach, so display only last returned (or
use sort() in php)
It seems like a choice between needing FM to sort each found record's
related records (before sending to the web), VS. pulling in
potentially a lot of related records per each found record, only to
need just the last of each.
I'm guessing it's better to sort in FM (option a) and just pull one
related record for each parent found, but does anyone have experience
w/ this (or an opinion ;) ?
Notes:
- I can't just find the related child records because some of the
found parent records may not have child records, and I need to show
them anyway.
- Most queries will pull fewer than 10 parent records, though a few
may find around 40.
TIA,
-Joel
Joel Shapiro - FileMaker Pro Database Design
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
joelshapiro at jsfmp dot com
http://www.jsfmp.com
415-269-5055
More information about the FX.php_List
mailing list