mysql_pconnect -- Open a persistent connection to a MySQL server mysql_pconnect() acts very much like mysql_connect() with two major differences. First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection. Second, the 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()).
blueoxygen(有你在身旁 心更坚强) :请问,您有没有响应的代码,能发到 谢谢!
建议不要用pconnect了,看我贴 http://expert.csdn.net/Expert/TopicView1.asp?id=2293516如果你用虚拟主机的话, 很有可能php.ini中: [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent = Off <=这里很可能已经被你的ISP改成off了. 如果是on的话很消耗服务期的资源. 可以到php网站上看pconnect函数说明页下面用户的评论.现在我也想把mysql.allow_persistent 设为off, 但是关心的是这样我那些php代码中都没有close连接, 这些连接是否可以自动关闭
mysql_pconnect() acts very much like mysql_connect() with two major differences. First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection. Second, the 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()).
谢谢!
http://expert.csdn.net/Expert/TopicView1.asp?id=2293516如果你用虚拟主机的话, 很有可能php.ini中:
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = Off <=这里很可能已经被你的ISP改成off了. 如果是on的话很消耗服务期的资源. 可以到php网站上看pconnect函数说明页下面用户的评论.现在我也想把mysql.allow_persistent 设为off, 但是关心的是这样我那些php代码中都没有close连接, 这些连接是否可以自动关闭