diff --git a/reference/mysql/functions/mysql-connect.xml b/reference/mysql/functions/mysql-connect.xml index a0981a3a14..2e181510b5 100644 --- a/reference/mysql/functions/mysql-connect.xml +++ b/reference/mysql/functions/mysql-connect.xml @@ -1,99 +1,93 @@ - + - - - mysql_connect - Open a connection to a MySQL Server - - - Description - - resourcemysql_connect - stringserver - stringusername - string - password - - bool - new_link - - int - client_flags - - + + + mysql_connect + Open a connection to a MySQL Server + + + Description + + resourcemysql_connect + stringserver + stringusername + stringpassword + boolnew_link + intclient_flags + + + Returns a MySQL link identifier on success, or &false; on failure. + + + mysql_connect establishes a connection + to a MySQL server. The following defaults are assumed for + missing optional parameters: server = + 'localhost:3306', username = name of the + user that owns the server process and + password = empty password. + + + The server parameter can also include a port + number. e.g. "hostname:port" or a path to a local socket + e.g. ":/path/to/socket" for the localhost. + - Returns a MySQL link identifier on success, or &false; on failure. + Whenever you specify "localhost" or + "localhost:port" as server, the MySQL client library will + override this and try to connect to a local socket (named pipe on + Windows). If you want to use TCP/IP, use "127.0.0.1" + instead of "localhost". If the MySQL client library tries to + connect to the wrong local socket, you should set the correct path as + mysql.default_host in your PHP configuration and leave the server field + blank. - mysql_connect establishes a connection - to a MySQL server. The following defaults are assumed for - missing optional parameters: server = - 'localhost:3306', username = name of the - user that owns the server process and - password = empty password. + Support for ":port" was added in PHP 3.0B4. - The server parameter can also include a port - number. e.g. "hostname:port" or a path to a local socket - e.g. ":/path/to/socket" for the localhost. - - - Whenever you specify "localhost" or - "localhost:port" as server, the MySQL client library will - override this and try to connect to a local socket (named pipe on - Windows). If you want to use TCP/IP, use "127.0.0.1" - instead of "localhost". If the MySQL client library tries to - connect to the wrong local socket, you should set the correct path as - mysql.default_host in your PHP configuration and leave the server field - blank. - - - Support for ":port" was added in PHP 3.0B4. - - - Support for ":/path/to/socket" was added in - PHP 3.0.10. - - - You can suppress the error message on failure by prepending - a @ - to the function name. - - + Support for ":/path/to/socket" was added in + PHP 3.0.10. - If a second call is made to mysql_connect - with the same arguments, no new link will be established, but - instead, the link identifier of the already opened link will be - returned. The new_link parameter modifies this - behavior and makes mysql_connect always open - a new link, even if mysql_connect was called - before with the same parameters. The client_flags - parameter can be a combination of the constants - MYSQL_CLIENT_COMPRESS, - MYSQL_CLIENT_IGNORE_SPACE or - MYSQL_CLIENT_INTERACTIVE. + You can suppress the error message on failure by prepending + a @ + to the function name. - - - The new_link parameter became available - in PHP 4.2.0 - - - The client_flags parameter became available in - PHP 4.3.0 - - - - The link to the server will be closed as soon as the execution of - the script ends, unless it's closed earlier by explicitly calling - mysql_close. - - - - <function>mysql_connect</function> example - + + + + If a second call is made to mysql_connect + with the same arguments, no new link will be established, but + instead, the link identifier of the already opened link will be + returned. The new_link parameter modifies this + behavior and makes mysql_connect always open + a new link, even if mysql_connect was called + before with the same parameters. The client_flags + parameter can be a combination of the constants + MYSQL_CLIENT_COMPRESS, + MYSQL_CLIENT_IGNORE_SPACE or + MYSQL_CLIENT_INTERACTIVE. + + + + The new_link parameter became available + in PHP 4.2.0 + + + The client_flags parameter became available in + PHP 4.3.0 + + + + The link to the server will be closed as soon as the execution of + the script ends, unless it's closed earlier by explicitly calling + mysql_close. + + + + <function>mysql_connect</function> example + ]]> - - - - - See also - mysql_pconnect and - mysql_close. - - - + + + + + See also + mysql_pconnect and + mysql_close. + + +