How to make database connection to mysqli in php?

Report
Question
19 views

Please explain why do you think this question should be reported?

Report Cancel
<?php
$con = mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?>
Please follow and like us: