Page 1 of 1

Close connection

Posted: Tue Aug 17, 2004 5:58 am
by CerIs
I always thought php closed your database connection automaticly. However i think this is not the case when using mysql_pconnect ? How do you close it?

Posted: Tue Aug 17, 2004 6:29 am
by Buddha443556
If you need the connection to close then use mysql_connect().

Posted: Tue Aug 17, 2004 7:07 am
by CerIs
Does that mean it closes automaticly?

Posted: Tue Aug 17, 2004 7:34 am
by Buddha443556
Yes, if you use mysql_connect() it will close automatically. If you use mysql_pconnect() the conection will be open between requests and will not close when the script ends. Even mysql_close() will not close a mysql_pconnect() link.