Re: How to drop a table when user leaves prematurely?

From: Date: Tue, 17 Jul 2001 10:10:55 +0000
Subject: Re: How to drop a table when user leaves prematurely?
Groups: php.db 
Request: Send a blank email to php-db+get-10513@lists.php.net to get a copy of this message
What I would do is issue the create table statement and check for a return code that say it already exists. If it does, drop it then create it. If it doesn't exist, then it will be created and your application continues. Don't bother writing a query to see if it exists and then perform an action (drop/create or create). That is an inefficient use of resources and a waste of code. -----Original Message----- From: BD <bd@bustdustr.net> To: php-db@lists.php.net <php-db@lists.php.net> Date: Sunday, July 15, 2001 11:25 PM Subject: [PHP-DB] How to drop a table when user leaves prematurely? Ugh! I'm sure this is fairly simple, but I have yet to come up with a way to do it... In a nutshell, our application creates, uses and drops a table while the user is working on the site. Unfortunately, because of "other considerations", we can't use a defined temp table - it has to be created as a regular table. We have a routine in the app that will drop the table once the user is done with their work, but if they leave for some reason before they're done, the table is left hanging out there. This wasn't a problem at first, but we're building up quite a collection of useless tables right now. Is there any way to drop the table automagically when the user leaves prematurely, either by closing their browser or jumping to another site? I tried using register_shutdown_function(), but it didn't seem to have any effect... I think, and I know I may be way off base, is that there are a lot of pages involved in this application, and I'm not sure how to tell the app that the user is just going from one page to the next or is actually going bye-bye... -BD- http://www.bustdustr.net http://www.rfbdproductions.com The Entertainment Center Home Of Radio Free BD For A Difference.

« previous php.db (#10513) next »