MySQL function library: mysql_pconnect

Source: Internet
Author: User
Keywords mysql_pconnect mysql function Library php Chinese function manual
Tags aliyun function function library hostname html http link mysql

Mysql_pconnect

(PHP3, PHP4)

Mysql_pconnect---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Open MySQL server continuous connection

Syntax: int mysql_pconnect ([string hostname [:p ort] [:/path/to/socket] [, String username [, string password]])

Description:

Success returns a positive number of MySQL link identifier, failure returns the error message.

Mysql_connect () set up MySQL server link, all parameters are not required, if you do not give the parameter value, the default is assumed to be (' localhost ', with the server processing user name, no password).

Hostname can also include port numbers, such as "hostname:port" or the socket path, for example: ":/path/to/socket"

Note: ":p ort" is added to the PHP3.0B4, PHP3.0.10 provides ":/path/to/socket", and you can use ' @ ' (@mysql_connect ()) to suppress the message returned when the error occurs.

Mysql_pconnect () is very similar to mysql_connect (), and there are two major differences between them.

First, when the link time function will first try to find the same host, the user name, the password of the previously opened link, if found, then this identifier will be returned to replace the opening of a new link.

Second, when the program is finished, it will not close the connection to the MySQL server, but will be retained for later use. (Mysql_close () will not be able to close the link opened with Mysql_pconnect ())

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.