Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Verifique a conexão com o banco de dados, caso contrário, exiba a mensagem


Tente isto:
<?php
$servername   = "localhost";
$database = "database";
$username = "user";
$password = "password";

// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
   die("Connection failed: " . $conn->connect_error);
}
  echo "Connected successfully";
?>