I was debugging my code when a surprising error happened. There are a number of issues with the connection to the database.
ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
( ! ) Fatal error: Uncaught exception 'PDOException' with message ' in C:\wamp\www\web\main\users.php on line 15
( ! ) PDOException: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. in C:\wamp\www\web\main\users.php on line 15
This is the code of where the error is pointing
function __construct()
{
$this->con = new PDO("mysql:host=".$this->host.";dbname=".$this->db,$this->user,$this->pass);
}
Since I don't frequently experience issues like this, I haven't done any research on WAMP, thus I'm not sure what to do. I appreciate you helping me.