On Saturday, March 10, 2001 at 7:03 AM, Todd Cary <[EMAIL PROTECTED]>
wrote:
> 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.
-- snip --
I haven't used Interbase, but if it's like most of PHP's database
interfaces, it isn't too critical to worry about closing the database
connection. PHP will do so automatically when your script ends.
-- unsnip --
>
> 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?
-- snip --
The Interbase extensions to PHP support persistent connections:
http://www.php.net/manual/en/function.ibase-pconnect.php (see
mysql_pconnect() as well for more general info on persistent connections).
With persistent connections, the overhead in connecting to the database
backend is minimized since the same connection can be shared across multiple
pages. This won't work with the CGI version of PHP however.
- Daniel Grace <http://dewin.oldbattery.com/>
"Space may be the final frontier but its made in a Hollywood basement."
- Red Hot Chili Peppers - Californication
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]