Monday, 27 June 2016

how to connect database in php using xampp server

Step 1:

Create Database see tutorial Create Database in MySql server

Step 2:

PHP script to connect Database // connect.php

<?php

//mysqli_connect('host_name','user_name','user_password','database_name');

$conn = mysqli_connect('localhost','root','','test_db');

if(!$conn){
echo 'connection error!';
}
?>



No comments:

Post a Comment