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

//$pass= it is secret bois haha

$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( 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.


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.