CM wrote:
> What do you do if you have a huge form that you want broken up into several
> different forms but each time the submit button is pressed the info is saved
> to the sql table.
> 
> Do you just create the table on the first form submit and then on each
> subsequent form you just update the table?

If you just do that chances are your table will be mostly made of 
uncomplete (and useless) records. It looks like a long sequence and many 
a user will leave it uncomplete.

If you want to save DB performance (by not fragmenting the table too 
much) you'll better do that on a temporary table that has the same 
format of the real table plus two more fields:
1) a session identifier (use something like a session id to recognize 
current user input).
2) a timestamp.
This temporary table usually will have no referential checks (as they 
might need full data set to make sense). Still, referential integrity 
should be checked along the way by some code.

Once you finally have all the stuff you need you just:

1) select previous data from temporary table
2) add last form input
3) insert it in the real table
4) delete from the temporary table the record having the current identifyer.

Still, the temporary table will be crowded with all the uncomplete 
sequences. If you cannot set a cleaning job on the server's chron just 
have the first form of your input sequence delete all temporary records 
that are older than delta time (where delta depends on the input process 
you are managing).

This way your real table stays compact and DB performs much better.

Alberto
Kiev


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is.......


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to