Does not connect to the database and does not return any errors

0
Hello, I made my site through xampp on windows, when I migrated to the ubunto I realized that mysql simply did not work, and did not return any error, for example, on the home page of the site I already use mysqli_connect even with the wrong user does not return any error.

No need to show code, because in xampp it works perfectly.

Making the connection:

$conn = mysqli_connect(SQL_HOST, SQL_USUARIO, SQL_SENHA, SQL_BANCO);
    
asked by anonymous 30.03.2017 / 17:10

2 answers

0

Add the following lines to get the error:

// verificar a conexão
if (mysqli_connect_errno()){
  echo "Falha ao conectar ao servidor: " . mysqli_connect_error();
}
    
30.03.2017 / 17:27
0

  •     
  • 30.03.2017 / 17:37