Get error "SQLSTATE [HY000] [2002] Connection denied"


#1

is there something wrong with my code?

<?php try { $db = new PDO('mysql:host=files.000webhost.com;dbname=id5732426_kbp','sekolah-mimpi', 'webpassword'); } catch (PDOException $e) { echo $e->getMessage(); die(); } ?>

#2

Helle there, Please can you give us more clear report on what you were doing when you encounter this problem?


#3

host is LOCALHOST
not what you have written above.