PHP mySQL - When is the best time to disconnect from the database?

前端 未结 6 606
抹茶落季
抹茶落季 2020-12-03 17:08

I use lazy connection to connect to my DB within my DB object. This basically means that it doesn\'t call mysql_connect() until the first query is handed to it, and

6条回答
  •  独厮守ぢ
    2020-12-03 17:37

    You may want to look at a using persistent connections. Here are two links to help you out

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

    http://us2.php.net/manual/en/function.mysql-pconnect.php

提交回复
热议问题