[FX.php List] [OFF] Duplicate Record in different Table

Bob Patin bob at patin.com
Tue Jan 6 12:51:03 MST 2009

I think your question relates to FX just as well...

Assuming you can store an array in a session variable (I've never  
tried), I'd do it that way, but the problem there is remembering which  
array element equates to which field.

I like to be able to look at my code a month later and immediately  
grok what I was doing; for that reason, and some will undoubtedly  
disagree with me, I go the long way around sometimes and put POST  
elements into variables, so that I can use them in multiple places on  
the page without having to re-grab the POST value.

So I'd probably do it the most obvious way, and create 50 session  
variables, all with the similar names (or same) names as the fields  
they pertain to. That way, when you need to plug them back in for  
whatever reason, you don't have to scratch your head and remember what  
array element #15 equates to...

Bob Patin
Longterm Solutions LLC
bob at longtermsolutions.com
Twitter: bobpatin
iChat/AIM: bobpatin
FileMaker 9 Certified Developer
Member of FileMaker Business Alliance & TechNet
FileMaker hosting and consulting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting

On Jan 6, 2009, at 1:36 PM, Jonathan Schwartz wrote:

> [OFF]...because this question is about the API, although the answer  
> might be the same in fx.php.
> I need to preserve a copy of record data before a web user edits the  
> record...in case the data needs to be restored.
> Upon login, I want to query the layout and then immediately turn  
> around and create a new record in a second table, using all the data  
> returned by the query.   Assume that the fields in both tables are  
> identically named.
> Sure, I could write each of the fields to a separate SESSION  
> variable and then create the add query using those fields, but with  
> 50 or so fields, that's not pretty.
> I know there is a way to simply take the array returned by the API  
> and reverse engineer it to create the add new record query....but  
> I'm at a loss.

More information about the FX.php_List mailing list