April 3, 2016
Creating a PHP MySQLi Database Connection using XAMPP

Friends in this tutorial I show you how to create a PHP MySQL database connection using XAMPP. Before storing or accessing the data, we want to create a database first. To connect the Mysql database we need to enter hostname, username, password and database name. Then we will connect MySQL database through PHP mysqli_connect. By using IF statement we checking it is connected successfully or not.
index.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "tut"; // Create connection in mysqli $conn = mysqli_connect($servername, $username, $password, $dbname); //Check connection in mysqli if(!$conn){ die("Error on the connection" .mysqli_error()); } else { echo "Connected Sucessfully"; } ?> |
Download
Mraj
Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts. If you have any questions let me drop an email with the article name to the following email id: [email protected]