1

It is know that connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect()).

So when does the mysql_pconnect() connection gets closed ?

indianwebdevil
  • 4,879
  • 7
  • 37
  • 51

2 Answers2

0

You should read this:

http://www.php.net/manual/en/features.persistent-connections.php

Andreas Rehm
  • 2,222
  • 17
  • 20
0

pconnect connections closes only when:

a) apache is restarted/stopped

b) mysql is restarted/stopped

c) After a specified amount of time, as set in the my.cnf file

But it shouldn't matter anyways, as the point of opening a persistent connection is to keep it open and avoid the overhead of making a new connection anyways. If you do another pconnect, it'll just use the existing connection or make a new one if none exists.