0

I've ruled out the possibility of supplying an incorrect name or password in mysqli_connect, because when I change them to make them incorrect on purpose, I actually get an error message from mysqli_connect_error(). With the code below, the connection fails, but I get no error message. I am out of ideas. What do you recommend I do next to debug?

 <?php

        $con = mysqli_connect("eu-cdbr-west-02.cleardb.net", "b497f08cc1919a", "7d15759b", "heroku_8d537c3a6f00758"); 

        if (!$conn) 
        {
            die("Connection failed: " . mysqli_connect_error());
        }
        echo "Connected successfully";


    ?>

Edit: As Seth pointed out, I mistyped the name of a variable. I'm sorry, I'll see myself out. :(

Hagel
  • 9
  • 1

1 Answers1

0

Your code is using $con for the connection but checking $conn. If you don't see the "Connected successfully" text your app as a whole likely has yet another problem. Usually you'd put that in the else part.

Seth
  • 1,215
  • 15
  • 35