★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum4/HTML/000498.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  MySQL
  persistentce of connection

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   persistentce of connection
jake
Member
posted May 25, 2000 09:51 PM     Click Here to See the Profile for jake   Click Here to Email jake     Edit/Delete Message Reply w/Quote
I wish to have a series of form pages, each being built dynamically. Yet, all the results from the compleat set of form pages combines into one record.

I'd like to use temporary tables to accomplish this because I don't want to have to deal with partial records from people who have decided not to compleat the form.

Will the database connection persist through out the series of forms?

rycamor
Member
posted May 26, 2000 12:11 AM     Click Here to See the Profile for rycamor   Click Here to Email rycamor     Edit/Delete Message Reply w/Quote
Yes, I believe you can have a persistant connection, but that is missing the point; The operation can be done without a persistant connection. What I really don't understand is why even bother with temp tables; seems like you're unnecessarily complicating things. You'll have to put too much work into maintaining data integrity.

If I were you I would just push the data from one form to the next, using cookies, or urlencode it (or even the overly simple hidden form fields), then when you reach the last form, do one INSERT that writes the whole record. You might have to put a bit of thought into error handling, but not nearly as much as mucking about with temp tables.

jake
Member
posted May 26, 2000 09:09 AM     Click Here to See the Profile for jake   Click Here to Email jake     Edit/Delete Message Reply w/Quote
quote:
Originally posted by rycamor:
Yes, I believe you can have a persistant connection, but that is missing the point; The operation can be done without a persistant connection. What I really don't understand is why even bother with temp tables; seems like you're unnecessarily complicating things. You'll have to put too much work into maintaining data integrity.

If I were you I would just push the data from one form to the next, using cookies, or urlencode it (or even the overly simple hidden form fields), then when you reach the last form, do one INSERT that writes the whole record. You might have to put a bit of thought into error handling, but not nearly as much as mucking about with temp tables.



But is this practical for forms with 100 or more elements? The elements are placed in the form dynamically, in random order, and in some cases, respondents will have additional questions depending on previous responces. So with a 100 question form, there will be at least 200 numbers to pass. That's way too many for cookie or URL.


[This message has been edited by jake (edited May 26, 2000).]

[This message has been edited by jake (edited May 26, 2000).]

rod k
Member
posted May 26, 2000 02:22 PM     Click Here to See the Profile for rod k   Click Here to Email rod k     Edit/Delete Message Reply w/Quote
Yes, with that many you probably should have some form of temporary table with a cron job expiring unfinished transactions after a set amount of time.

That said, persistent connections have nothing to do with this subject. All that a persistent connection does is maintain the webserver <-> SQL server connection after the script is finished executing to relieve the overhead of establishing a connection. Your scripts still have to maintain the data integrity of user state, persistent connections can't do that for you.

[This message has been edited by rod k (edited May 26, 2000).]

jake
Member
posted May 26, 2000 03:25 PM     Click Here to See the Profile for jake   Click Here to Email jake     Edit/Delete Message Reply w/Quote
quote:
Originally posted by rod k:
Yes, with that many you probably should have some form of temporary table with a cron job expiring unfinished transactions after a set amount of time.

That said, persistent connections have nothing to do with this subject. All that a persistent connection does is maintain the webserver <-> SQL server connection after the script is finished executing to relieve the overhead of establishing a connection. Your scripts still have to maintain the data integrity of user state, persistent connections can't do that for you.

[This message has been edited by rod k (edited May 26, 2000).]


Yes, user state is what I was thinking of.

The cron job thing is the only other conclusion I had come up with, so it's good to know you think the same, then I'm on the right track...

Thanks

mcsimon
Junior Member
posted May 27, 2000 07:18 AM     Click Here to See the Profile for mcsimon   Click Here to Email mcsimon     Edit/Delete Message Reply w/Quote
jake,

wouldn't javascript in a frameset do what you are asking? You could build dynamic forms and store the info as the user moves from form to form.

possible option.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.