Error connecting to server

I have a simple php script that I’m trying to connect with on the server but I keep getting the error below. I have checked my host name(my website),username,password and database credentials all match with the php script,but the error still persists.Moreover I tried using another web-hosting platform and it worked,I don’t know what I’m missing out. Help needed.

Warning: mysqli_connect(): (HY000/2002): Connection refused in /storage/h7/782/1225782/public_html/check.php on line 7

What host are you using please?

here is my php script:

<?php $host_name="employee-site.000webhostapp.com"; $username="id1225782_seller_username"; $password="xxxxxxxx"; $database_name="id1225782_seller_db"; $result = mysqli_connect($host_name,$username,$password,$database_name); if($result) echo "Connected"; else echo "Failed to connect".mysqli_error(); ?>

host is localhost :slight_smile:

hehe…thanks I didn’t see that