問題描述
簡而言之,是否有某種 mysqli_pconnect
用于高使用率的 PHP
&MySQL
服務器,還是我需要堅持使用未改進的 mysql
?如果是這樣,他們為什么要刪除它?
In short, is there some sort of mysqli_pconnect
for high-usage PHP
& MySQL
servers, or do I need to stick with mysql
unimproved? And if so, why did they remove it?
推薦答案
對此的支持是在 PHP 5.3 中引入的.對于此之前的版本,PDO 和 - 上帝保佑 - mysql 擴展是唯一的選擇.
Support for this was introduced in PHP 5.3. For versions before this, PDO and – god forbid – the mysql extension are the only options.
引用手冊:
與mysql擴展不同,mysqli沒有提供單獨的開啟持久連接的功能.要打開持久連接,您必須在連接時將 p: 添加到主機名.
Unlike the mysql extension, mysqli does not provide a separate function for opening persistent connections. To open a persistent connection you must prepend p: to the hostname when connecting.
這篇關于mysqli 持久連接的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!