michaelsanford
Translator, Web Developer
I've got a script that makes multiple accesses to a single dba. The script takes a form and checks a database for one of the elements in the form (it must be unique) and if it's already there re-displays the form. once all the verifications are complete it inserts a new record.
What are the advantages to using mysql_pconnect() over mysql_connect() ? Also, if I open a connection with mysql_pconnect() and the user takes a REALLY long time to correct data and resubmit the form, could the connection time out? How can I find out what the default connection timeout duration is?
Most importantly, what happens if I issue mysql_pconnect() twice? That is, once in the unique element verification, and then again in the dba insert routine? Will it create multiple connections and clog everything, or will it detect that I have already made a connection and use that one? (everywhere in ym script I use the optional MySQL connection pointer assigned by $connectionID = mysql_pconnect("", "", ""), so I presume if it does use the existing connection, it will assign my link pointer to the old connection?) I use the link pointer in places like $result = mysql_query("SELECT * FROM users", $connectionID);
I know that's convoluted, but thanks!
What are the advantages to using mysql_pconnect() over mysql_connect() ? Also, if I open a connection with mysql_pconnect() and the user takes a REALLY long time to correct data and resubmit the form, could the connection time out? How can I find out what the default connection timeout duration is?
Most importantly, what happens if I issue mysql_pconnect() twice? That is, once in the unique element verification, and then again in the dba insert routine? Will it create multiple connections and clog everything, or will it detect that I have already made a connection and use that one? (everywhere in ym script I use the optional MySQL connection pointer assigned by $connectionID = mysql_pconnect("", "", ""), so I presume if it does use the existing connection, it will assign my link pointer to the old connection?) I use the link pointer in places like $result = mysql_query("SELECT * FROM users", $connectionID);
I know that's convoluted, but thanks!