How To Connect Database in Core Php

How To Connect Mysqli in Php  




+








<?php

$servername = 'localhost';
$username = 'root';
$password = '';
$db_name = 'Database Name';


$con = mysqli_connect($servername,$username,$password,$db_name);

// Check connection

if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}

?>

Post a Comment

0 Comments