I have just joined and trying to get PHP to connect to database

I am a first time user and am trying to get a simple PHP screen to connect to my MYSQL server.
The details of the PHP I am using is below but I am getting a timeout error.
Can anyone help?

Username (e.g. epiz_XXX) or Website URL

andytest.infinityfreeapp.com

Error Message

Connection failed: Connection timed out

Other Information

<?php $servername = "sql113.epizy.com"; $username = "epiz_29978566"; $password = "password as described in the control panel"; // Create connection $conn = new mysqli($servername, $username, $password); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully"; ?>

I checked your account and I cannot find this exact code.

I see Page02.php, but that one still has the placeholder server hostname, not sql113.epizy.com.

And if you’re trying to test this on your own computer first, then please note that our database servers are not accessible from the internet, so you can only use them from PHP code hosted with us.

2 Likes

Thank you.
I thought I had copied over the updated version.
That now connects.

Thanks Again

Andy

3 Likes

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