Connect Error: 2002 Unable to connect

<?php

           define("SERVER", 'sql304.epizy.com');
           define("USER", 'epiz_26809984');
           define("PASSWORD", '*********');
           define("DB", 'epiz_26809984_leighrufc');


           $con = @mysqli_connect(SERVER,USER,PASSWORD,DB);

    if (!$con) {
        die('Connect Error: ' . mysqli_connect_errno() . PHP_EOL);
    }
?>

So this is my code.
My hostname doesn’t seem to be working. I have been through the forums but haven’t found a solution yet. I have copied everything directly from the credentials for the sql server.
whenever i try to access it as a url there is nothing and I get no connection at all.
Whenever i go to PHPMyAdmin i see the IP address of the SQL server. That gives me the Error 2002 problem. Am i missing something ridiculous?

What error is displayed? Whats the site URL?

The error displayed is Connect Error: 2002.
And i am trying to use the page as a web service so i am trying to pass parameters through a php page.

Please. Provide. The. URL

http://leighrufc.rf.gd/

Can u enable show errors in the cpanel

done

Do you see same error there too? If yes, Someone else had same issue with sql304.epizy.com:
Sqlstate error

No when i access PHPMyAdmin through the CPanel it’s fine

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