[FX.php List] About scripts

Jonathan Schwartz jonathan at eschwartz.com
Mon Sep 25 18:55:22 MDT 2006


Thanks for the heads up.  I think that I'll steer clear of scripts 
and go with Plan B.. or perhaps Plan C. ;-)

Here's the run down...

This is Ver2 of my first fx project, a school directory. There is a 
Households table, a Contacts (parents) table and a Students table. 
Finally, there is a Family table, which sits on top of the three 
other tables.  It is summary data from the Family table that is 
desired.  The data desired is compilation of the each Households and 
the Contacts and Students associated with each.  In short... names 
and addresses of who lives where.

In ver1 of this project, I used a completely flat file.  All data was 
on one table. It was easy to implement in fx.  After the users did 
their data entry and edits, I split the data into the multiple 
tables.  But, that pulled the plug on any further data entry into the 
online system, once the data was exported.

This year, in ver 2, I went the "high road" and implemented a 
relational system where data is entered directly into the various 
tables by online entry.  However, the challenge is how to pull the 
data back into the Families table (in real time) so that the user can 
proof read the result

Plan A was to use a series of scripts which pulled the data from the 
related tables up into the Family table.  I planned to run the script 
once all the edits were complete.  Per my earlier post, I'm getting 
flaky results with the the scripts.

Plan B could be just to use calc fields to extract the table data 
from each table.  With a max of 2 households, 2 contacts per 
household and up to 5 students per house (yup!), the calcs are finite.

Your email prompted a third option, Plan C: to interrogate the tables 
in php with For Each loops and extract the data that way. Perhaps 
create an array for each table and then populate the Family values 
from the arrays.  Or, just populate the data right into the desired 
fields as the data is processed. See end result below:

Students	Stu1	Stu2	Stu3	Stu4	Stu5...

Household1
	Street1	City1	State1	Zip1 Phone1
	ContactFirst1	ContactLast1	ContactEmail1	ContactCell1
	ContactFirst2	ContactLast2	ContactEmail2	ContactCel2

Household2
	Street2	City2	State2	Zip2 Phone2
	ContactFirst3	etc
	ContactFirst4	etc

Think that I'll try it now...;-)

Will yell if I have trouble.

Jonathan



>my advice about using scripts was because of performance issues. it 
>blocks access to all FMP WPE for all other requests for as long as 
>the script runs. as far as performance flaws goes, there is some 
>getting used to calling scripts because of the fact that multiple 
>requests to the db through FX (as in not using prefind for instance) 
>are not treated the same way with reference to globals - FMP global 
>fields  are cleared (reset to default) each new FX request.
>
>you're probably better off doing whatever you are trying to do in 
>PHP anyway... can you spell it out and maybe someone here can give 
>you a tip?
>
>dan
>
>On Sep 25, 2006, at 7:40 PM, Jonathan Schwartz wrote:
>
>>
>>I'v heard recent advice not use scripts.  I'm not sure if it was 
>>because of performance slowdowns or performance flaws.
>>
>
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 

Jonathan Schwartz
FileMaker 8 Certified  Developer
Associate Member, FileMaker Solutions Alliance
Schwartz & Company
jonathan at eschwartz.com
http://www.eschwartz.com
http://www.exit445.com
415-381-1852



More information about the FX.php_List mailing list