How to connect to MySQL with PHP Print

  • 0

<?php
$servername = "ServerName";
$username = "DatabaseUsername";
$password = "DatabasePassword";

$conn = new mysqli($servername, $username, $password);

if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>

Was this answer helpful?

« Back