douxiangbiao1899 2014-02-14 12:15
浏览 33
已采纳

我们需要在Zend框架2中使用mysql_close()吗? [重复]

This question already has an answer here:

I am using Zend framework 2 in my application. Recently, my website got down. The server contact person told us MySQL reported most of the connections were timing out. The reason he gives us is that the MySQL connections are not calling mysql_close() function before exiting.

Do we need to use mysql_close() in applications?

</div>
  • 写回答

1条回答 默认 最新

  • doushenjia8514 2014-02-14 16:49
    关注

    Based on the comments of your question, using mysql_close is unnecessary since you are using PDO.

    As @Tim Fountain mentioned in the comment, PHP will automatically close the connection once the script is done running, unless if you are using the persistent connection (which is usually causes problems, I learned this in a hard way).

    If the connection to database server keeps timing out, there is a problem on the connection between PHP and MySQL database server, not the script.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题