Open a new connection to the MySQL server:
The mysqli_connect() function opens a new connection to the MySQL server.
| Parameter | Description |
|---|---|
| host | Optional. Specifies a host name or an IP address |
| username | Optional. Specifies the MySQL username |
| password | Optional. Specifies the MySQL password |
| dbname | Optional. Specifies the default database to be used |
| port | Optional. Specifies the port number to attempt to connect to the MySQL server |
| socket | Optional. Specifies the socket or named pipe to be used |
| Return Value: | Returns an object representing the connection to the MySQL server |
|---|---|
| PHP Version: | 5+ |
PHP MySQLi Reference
Your message has been sent to W3Schools.