mysqli_connect() – function php mysql db connect
The mysqli_connect() function opens a new connection to the MySQL server.
Syntax:
mysqli_connect(host,username,password,dbname,port,socket);
Parameter | Description |
---|---|
host | Specifies a host name or an IP address |
username | Specifies the MySQL username |
password | 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 |