NYCPHP Meetup

NYPHP.org

[nycphp-talk] Flexible Forms & How to store them...

Brian Dailey support at dailytechnology.net
Tue May 15 10:45:19 EDT 2007


I have several large forms that I am putting together. I'm aiming to 
keep them flexible and make it fit within the database object schema 
that I have used so far in this particular program.

In the past with a large form I've seen some developers resort to tables 
with a multitude of columns... I thought that this was a kludgy solution 
and I'd like to avoid it if possible. Another way I've seen it handled 
is to have a header table and a detail table that works something like this:

table: documents (id, date, etc)
table: documentdetails (documentid, fieldname, fieldvalue)

All of the form values were stored in a fieldname=fieldvalue format 
inside the table. This worked nicely until you attempted to run reports 
on it - you couldn't easily combine data since it all existed in 
different table rows.

So, I humbly come before thee, o PHP gurus, and ask you, how would you 
advise approaching this? Are there other ways to handle huge forms? I 
have seen people serialize arrays and store them in a column, but I 
can't see that working well when creating reports.

I've googled and read around as much as I can on this one, but what I 
need is some advice from some more experienced developers. Opinions?

-- 

Thanks!
- Brian Dailey
Software Developer
New York, NY
www.dailytechnology.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: support.vcf
Type: text/x-vcard
Size: 264 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070515/3a359762/attachment.vcf>


More information about the talk mailing list