PHP mysqli_connect() Function
PHP provides mysqli_connect() function to open a SQL database connection. This function takes five parameters and returns a MySQLi link identifier on success or FALSE on failure.
Parameters: 1 server, 2 user, 3 password, 4 new_link, 5 client_flags.
Connect to MySQL server useing mysqli_connect() Function - how to create - example
Here is a simple example to connect to MySQL server
Example 1: mysqli_connect() Function
<?php
$link = mysqli_connect("localhost", "myuser", "mypassword", "mydb");
if (!$link) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
exit;
}
echo "Success: A proper connection to MySQL was made!" . PHP_EOL;
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;
mysqli_close($link);
?>
$link = mysqli_connect("localhost", "myuser", "mypassword", "mydb");
if (!$link) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
exit;
}
echo "Success: A proper connection to MySQL was made!" . PHP_EOL;
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;
mysqli_close($link);
?>
You can disconnect from MySQLi database anytime using another PHP function mysqli_close(). This function takes a single parameter, which is a connection returned by mysqli_connect() function.
php mysqli connect function
PHP mysqli_connect () Function - sql tutorial
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.