php temp table question (for mysql)

This is a discussion on php temp table question (for mysql) within the PHP General forums, part of the PHP Programming Forums category; Does anyone know whether the use of persistent connections with php will allow a temp table created by a script ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-27-2003
Larry Brown
 
Posts: n/a
Default php temp table question (for mysql)

Does anyone know whether the use of persistent connections with php will
allow a temp table created by a script to linger around and cause a problem
with the next execution of the script when it tries to create the temp table
again? Also if it does present a problem with the next script execution
trying to create the temp table again, if I drop the temp table at the end
of the script will I still have problems if the script is run by two client
in tandem? For instance two people connect, both hit the script at about
the same time. One script creates the temp table and before it can drop the
table the second script tries to create the table. Will it see the table
created by the other script? Again the use of persistent connections would
be a the heart of this I would think.
Reply With Quote
  #2 (permalink)  
Old 10-27-2003
Cpt John W. Holmes
 
Posts: n/a
Default Re: [PHP] php temp table question (for mysql)

From: "Larry Brown" <larry.brown@dimensionnetworks.com>

> Does anyone know whether the use of persistent connections with php will
> allow a temp table created by a script to linger around


No, the table will still be removed at the end of the script whether you use
persistant connections or not.

> and cause a problem
> with the next execution of the script when it tries to create the temp

table

Temporary tables are unique for that specific question. So you can have the
same script creating the "same" temporary table and 100 people hit it
without issues. Each script creates it's own temporary table with a unique
name that only that connection has access to.

---John Holmes...
Reply With Quote
  #3 (permalink)  
Old 10-27-2003
Cpt John W. Holmes
 
Posts: n/a
Default Re: [PHP] php temp table question (for mysql)

From: "CPT John W. Holmes" <holmes072000@charter.net>

> Temporary tables are unique for that specific question.


I mean "connection", not "question"...

I'm working on a survey system, so I have "questions" on my mind. :)

---John Holmes...
Reply With Quote
  #4 (permalink)  
Old 10-27-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] php temp table question (for mysql)

* Thus wrote Larry Brown (larry.brown@dimensionnetworks.com):
> Does anyone know whether the use of persistent connections with php will
> allow a temp table created by a script to linger around and cause a problem
> with the next execution of the script when it tries to create the temp table
> again? Also if it does present a problem with the next script execution
> trying to create the temp table again, if I drop the temp table at the end
> of the script will I still have problems if the script is run by two client
> in tandem? For instance two people connect, both hit the script at about
> the same time. One script creates the temp table and before it can drop the
> table the second script tries to create the table. Will it see the table
> created by the other script? Again the use of persistent connections would
> be a the heart of this I would think.


database temp tables don't last over persistent connections.


Curt
--
"My PHP key is worn out"

PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
Reply With Quote
  #5 (permalink)  
Old 10-31-2003
Larry Brown
 
Posts: n/a
Default RE: [PHP] php temp table question (for mysql)

I'm now finding that persistent connections is allowing the temp table to
remain. I have a sql query that creates the table and another that joins
the temp table to another for a result set that I use. If I press refresh on
the browser window I get an error that the sql query creating the table
fails. I prepend a query that removes the table before the sql that creates
it and then hit refresh and the query works. If I close the browser thus
ending the session and reopen the browser and log in, the script fails to
remove the temp table since it hasn't been created yet (and must have been
removed). I changed my method of connecting to use mysql_connect instead of
mysql_pconnect and removed the drop temp sql and it loads and reloads fine.
Perhaps it is the combination of mysql_pconnect with sessions that creates
this problem.

-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000@charter.net]
Sent: Monday, October 27, 2003 4:43 PM
To: Larry Brown; PHP List
Subject: Re: [php] php temp table question (for mysql)


From: "Larry Brown" <larry.brown@dimensionnetworks.com>

> Does anyone know whether the use of persistent connections with php will
> allow a temp table created by a script to linger around


No, the table will still be removed at the end of the script whether you use
persistant connections or not.

> and cause a problem
> with the next execution of the script when it tries to create the temp

table

Temporary tables are unique for that specific question. So you can have the
same script creating the "same" temporary table and 100 people hit it
without issues. Each script creates it's own temporary table with a unique
name that only that connection has access to.

---John Holmes...
Reply With Quote
  #6 (permalink)  
Old 10-31-2003
Marek Kilimajer
 
Posts: n/a
Default Re: [PHP] php temp table question (for mysql)

Session should not have any influence. Perhaps Keep-alive connection,
then by closing the browser the connection ends. If you would wait
enough the connection will be closed anyway.

But certainly this is valueable knowledge.

Larry Brown wrote:
> I'm now finding that persistent connections is allowing the temp table to
> remain. I have a sql query that creates the table and another that joins
> the temp table to another for a result set that I use. If I press refresh on
> the browser window I get an error that the sql query creating the table
> fails. I prepend a query that removes the table before the sql that creates
> it and then hit refresh and the query works. If I close the browser thus
> ending the session and reopen the browser and log in, the script fails to
> remove the temp table since it hasn't been created yet (and must have been
> removed). I changed my method of connecting to use mysql_connect instead of
> mysql_pconnect and removed the drop temp sql and it loads and reloads fine.
> Perhaps it is the combination of mysql_pconnect with sessions that creates
> this problem.
>
> -----Original Message-----
> From: CPT John W. Holmes [mailto:holmes072000@charter.net]
> Sent: Monday, October 27, 2003 4:43 PM
> To: Larry Brown; PHP List
> Subject: Re: [php] php temp table question (for mysql)
>
>
> From: "Larry Brown" <larry.brown@dimensionnetworks.com>
>
>>Does anyone know whether the use of persistent connections with php will
>>allow a temp table created by a script to linger around

>
>
> No, the table will still be removed at the end of the script whether you use
> persistant connections or not.
>
>
>>and cause a problem
>>with the next execution of the script when it tries to create the temp

>
> table
>
> Temporary tables are unique for that specific question. So you can have the
> same script creating the "same" temporary table and 100 people hit it
> without issues. Each script creates it's own temporary table with a unique
> name that only that connection has access to.
>
> ---John Holmes...
>

Reply With Quote
  #7 (permalink)  
Old 11-01-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] php temp table question (for mysql)

* Thus wrote Larry Brown (larry.brown@dimensionnetworks.com):
> I'm now finding that persistent connections is allowing the temp table to
> remain. I have a sql query that creates the table and another that joins
> the temp table to another for a result set that I use. If I press refresh on


How are you creating the temp table?

> the browser window I get an error that the sql query creating the table
> fails. I prepend a query that removes the table before the sql that creates
> it and then hit refresh and the query works. If I close the browser thus
> ending the session and reopen the browser and log in, the script fails to
> remove the temp table since it hasn't been created yet (and must have been
> removed). I changed my method of connecting to use mysql_connect instead of
> mysql_pconnect and removed the drop temp sql and it loads and reloads fine.
> Perhaps it is the combination of mysql_pconnect with sessions that creates
> this problem.


If this is the case it most likey is a mysql issue not a php one.


Curt
--
"My PHP key is worn out"

PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:39 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0