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);

ParameterDescription
hostSpecifies a host name or an IP address
usernameSpecifies the MySQL username
passwordSpecifies the MySQL password
dbnameOptional. Specifies the default database to be used
portOptional. Specifies the port number to attempt to connect to the MySQL server
socketOptional. Specifies the socket or named pipe to be used

Leave a Reply