anantamu.com


MySql Database connect using PHP


mysqli_connect — Open a connection to a MySQL Server.

MySQL is a database system , it is used to connect MySQl server.

MySQL: It is free software to download and use it.



CREATE DATABASE

<?php
$servername = "localhost";
$username = "root";
$password = "";
//server connection
$connection = mysqli_connect($servername, $username, $password);
if (!$connection) {
die("Connection failed: " . mysqli_connect_error());
}
echo "DB is connected!";
?>