Home  >  Article  >  Backend Development  >  PHP persistent connection mysql_pconnect usage example

PHP persistent connection mysql_pconnect usage example

WBOY
WBOYOriginal
2016-07-25 09:05:421064browse
  1. $conn = mysql_pconnect($host,$user,$pwd);
  2. mysql_select_db($dbname,$conn);
  3. $result=mysql_query("select * from table_name where col_id =' test_id'", $conn);
  4. $result_detail=mysql_fetch_array($result);
  5. $item = $result_detail['col_id'];
  6. ?>
Copy code

Note: as a high-concurrency processing database When requesting, using mysql_pconnect is not a good choice. At this time, issues such as caching and decentralization can be considered.



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn