問題描述
簡(jiǎn)而言之,是否有某種 mysqli_pconnect
用于高使用率的 PHP
&MySQL
服務(wù)器,還是我需要堅(jiān)持使用未改進(jìn)的 mysql
?如果是這樣,他們?yōu)槭裁匆獎(jiǎng)h除它?
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?
推薦答案
對(duì)此的支持是在 PHP 5.3 中引入的.對(duì)于此之前的版本,PDO 和 - 上帝保佑 - mysql 擴(kuò)展是唯一的選擇.
Support for this was introduced in PHP 5.3. For versions before this, PDO and – god forbid – the mysql extension are the only options.
引用手冊(cè):
與mysql擴(kuò)展不同,mysqli沒有提供單獨(dú)的開啟持久連接的功能.要打開持久連接,您必須在連接時(shí)將 p: 添加到主機(jī)名.
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.
這篇關(guān)于mysqli 持久連接的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!