MySQL is not outputting the error

I’m trying to connect to mysql using php, connection is failed but I’m unable to output the error.

Username: epiz_30963625
Site: http://guglesuggesstion.epizy.com/index2.php

<?php
$db_url="sql309.epizy.com";
$database_name="epiz_30963625_hit";
//$pass= it is secret bois haha
$user="epiz_30963625";

$con = mysqli_connect($db_url,$user,$pass,$database_name);
if (!$conn) {
echo "error"; //printing this
  echo mysqli_connect_error(); //not printing this
  echo mysqli_error($conn); //this one also
}else echo "Connected successfully";

?>

Output(http://guglesuggesstion.epizy.com/index2.php): error

MySQL details from client area:

pls help. this is first project.

You named the original connect $con, not $conn (notice the extra n). This is why those lines don’t work.
These are very obvious errors that you need to watch out for.

4 Likes

Silly Mistake by me haha.
It worked and thanks a lot.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.