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();
}
?>
0 Comments