mysql_connect

mysql link mysql_connect([string host[:port|:/path/to/socket]], 
 [string username], [string password]) 
host Host to connect to, with an optional port or socket component
username Username to log in with
password Password to log in with

Connects to a MySQL server.

Returns:

MySQL link on success; FALSE on failure

Description:

mysql_connect() is used to connect to a local or remote MySQL server. Normally it’s used as follows:

$mysql_link = mysql_connect ('some_host', 'some_user', 'some_password'); 

You can also let PHP supply optional arguments for all parameters.

The host argument should contain a domain name or an IP address, optionally followed by a port number. If no port number is specified, the default MySQL port of

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.