Re: [PHP] sessions and temporary tables
Temporary tables only exist for the duration of your script, with or without using mysql_pconnect(). If you want a MySQL table to remain, then don't make it temporary. Make it a regular table and then create a cron script that goes through and deletes tables that are more than X minutes/hours old. ---John Holmes... - Original Message - From: "Wilbert Enserink" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 18, 2002 5:21 AM Subject: [PHP] sessions and temporary tables hi all, i have this problem: 1) on the start of each script I call session_start() 2) on my search.php page I query an info-table, put the results in a temporary table called $SID(=session_id()), and display the results. As a check I also query the table $SID and voila: the results were indeed stored in this temporary table. 3) On my next page there is this checkbox which says: search within these results. 4) If this checkbox is checked I query the $SID table rather then the info table. 5) but now I get this error: Table 'dbname.ed61c337640e2b0ab8f3ffccb63f8597' doesn't exist as a check I print $SID on each page. and always it is the same SID, which makes sense cause i'm still in the same session. My Q: howcome mySQL is not able to find this temporary table anymore It seems to have destroyed this table when leaving the search.php page, but that's a rather odd idea, cause I thought it maintained while the session was still active... any input is largely appreciated! thx and regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sessions and temporary tables
unless you open a persistent connection, connections are closed automatically at the end of execution of a script. > -Original Message- > From: W. Enserink [mailto:[EMAIL PROTECTED]] > Sent: 18 June 2002 10:41 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] sessions and temporary tables > > > ok, that's clear, thx. > but still, I'm not closing any connection AFAIK. > at least not explicitly. are there then other ways which > cause the closing > of this connection? > > thx Wilbert > > > > > - Original Message - > From: "Jason Wong" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, June 18, 2002 11:31 AM > Subject: Re: [PHP] sessions and temporary tables > > > > On Tuesday 18 June 2002 17:21, Wilbert Enserink wrote: > > > > > i have this problem: > > > > > My Q: howcome mySQL is not able to find this temporary table > anymore > > > It seems to have destroyed this table when leaving the > search.php page, > but > > > that's a rather odd idea, cause I thought it maintained while the > session > > > was still active... > > > > Well sessions have nothing to do with MySQL tables (temporary or > otherwise). > > The reason why your table doesn't exist anymore is probably > because temp > > tables are only there for the duration of a particular > mysql connection. > Once > > the connection is closed the table is automatically purged. > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications > Development * > > > > /* > > If you refuse to accept anything but the best you very often get it. > > */ > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > - > Pas de Deux > Van Mierisstraat 25 > 2526 NM Den Haag > tel 070 4450855 > fax 070 4450852 > http://www.pdd.nl > [EMAIL PROTECTED] > - > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and temporary tables
ok, that's clear, thx. but still, I'm not closing any connection AFAIK. at least not explicitly. are there then other ways which cause the closing of this connection? thx Wilbert - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 18, 2002 11:31 AM Subject: Re: [PHP] sessions and temporary tables > On Tuesday 18 June 2002 17:21, Wilbert Enserink wrote: > > > i have this problem: > > > My Q: howcome mySQL is not able to find this temporary table anymore > > It seems to have destroyed this table when leaving the search.php page, but > > that's a rather odd idea, cause I thought it maintained while the session > > was still active... > > Well sessions have nothing to do with MySQL tables (temporary or otherwise). > The reason why your table doesn't exist anymore is probably because temp > tables are only there for the duration of a particular mysql connection. Once > the connection is closed the table is automatically purged. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > If you refuse to accept anything but the best you very often get it. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and temporary tables
On Tuesday 18 June 2002 17:21, Wilbert Enserink wrote: > i have this problem: > My Q: howcome mySQL is not able to find this temporary table anymore > It seems to have destroyed this table when leaving the search.php page, but > that's a rather odd idea, cause I thought it maintained while the session > was still active... Well sessions have nothing to do with MySQL tables (temporary or otherwise). The reason why your table doesn't exist anymore is probably because temp tables are only there for the duration of a particular mysql connection. Once the connection is closed the table is automatically purged. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* If you refuse to accept anything but the best you very often get it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php