Func Mysqli Connect
# PHP mysqli_connect() Function
[ PHP MySQLi Reference](#)
## Example
Open a new connection to a MySQL server:
* * *
## Definition and Usage
The mysqli_connect() function opens a new connection to a MySQL server.
* * *
## Syntax
mysqli_connect(_host,username,password,dbname,port,socket_)_;_
| Parameter | Description |
| --- | --- |
| _host_ | Optional. Specifies the hostname or IP address. |
| _username_ | Optional. Specifies the MySQL username. |
| _password_ | Optional. Specifies the MySQL password. |
| _dbname_ | Optional. Specifies the default database to use. |
| _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. |
## Technical Details
| Return Value: | Returns an object representing the connection to a MySQL server. |
| :--- |
| PHP Version: | 5+ |
* * PHP MySQLi Reference](#)
YouTip