$conn=mysqli_connect($server, $user, $password, $database);
echo "Server connected with database successfully.";
echo "Failed, unable to connect with database.";
Where localhost is server name it can be either localhost or 127.0.0.1 or sometime with port value like 127.0.0.1:8080
root is default user name
By default password is empty for default root user.
school is database name
This function is used to connect with database.
it is a connection variable and used to execute query on server.