Opening/closing a DB

From: Date: Sat, 10 Mar 2001 15:08:02 +0000
Subject: Opening/closing a DB
Groups: php.general 
Request: Send a blank email to php-general+get-43308@lists.php.net to get a copy of this message
I have some questions about PHP and it's interaction with a DB (namely, Interbase). My client's application uses a DB extensively and I am not clear about opening and closing a DB - the price one pays. First, I notice that the approximate time to open a connection to my DB on my test system is 1 second with a "locate time" of another second. So, 50% of the time is opening the DB. Now the structure of the application is such that the user may enter a page and a parameter is checked. Then depending on the results, the page is re-entered and another DB access is made, etc.. Each time an open and close is needed. Is there some method you experienced programmers use to minimize this? And every page requires at least one DB access. The next question envolves closing the DB and returning memory. ibase_free_result; ibase_close($dbh); What will happen if in my code I forget to do this in a place or two? Will the system eventually crash? I am not saying that I have intentually done this, *but* I may have left a DB open in a branching situation or just overlooked doing it in some place. Trying to learn.............. Todd -- Todd Cary Ariste Software todd@aristesoftware.com

« previous php.general (#43308) next »