Page 1 of 1

PHP not closing db connection

Posted: Thu Sep 26, 2002 6:53 am
by Johnm
Hi all,
Ever since I upgraded to PHP 4.2.2 (from 4.06) I find that the connestions to the database are not being closed even though I am using ifx_close($dbid) at the end of each page. Any ideas?

Direwolf

Persistent Links

Posted: Wed Oct 02, 2002 9:14 pm
by Baka2002
"...Note that this isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.
ifx_close() will not close persistent links generated by ifx_pconnect(). " "PHPManual"

Check to see if your using persistent links, maybe thats your problem

Posted: Wed Oct 02, 2002 9:44 pm
by Johnm
So, if ifx_close() has no effect on persistant connections and non persistant connections close at the end of the scripts execution then ifx_close has no purpose??? Why was it developed if it has no real use?

Direwolf

Posted: Thu Oct 03, 2002 2:02 am
by twigletmac
If you had a really long script and you only had your database stuff at the top you could close the connection before the end of the script because you no longer need it and want to free up database connections for other users. It just depends on your scripts really.

Mac