MySQL persistent connections and advantages of mysql_pconnect?

后端 未结 2 510
感情败类
感情败类 2021-01-12 11:14

I had never heard of persistent connections before, and I don\'t understand the advantages.

I run a PHP/MySQL based website, it receives tens of thousands of page vi

2条回答
  •  醉梦人生
    2021-01-12 11:34

    Check out this URL:

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

    Basically mysql_pconnect() tries to find a persistent connection already open with the credentials that you've specified. If it doesn't find one it makes a new one. It also doesn't close the connection after a statement is executed

    So really in your case you may not notice a difference but in reality you should probably be using mysql_pconnect().

提交回复
热议问题