Hey all!!
Got this error and made edits to my DB credentials in file but nothing is working. Trying to figure where the error is within my code but not successful.
<?php
$dbservername="";
$dbuser="";
$dbpass="";
$dbname="";
$conn=mysqli_connect($dbservername,$dbuser,$dbpass,$dbname);
class Relation {
// (A) CONSTRUCTOR - CONNECT TO DATABASE
private $pdo = null;
private $stmt = null;
public $error = "";
function __construct () {
try {
$this->pdo = new PDO(
"mysql:host=".DB_HOST.";dbname=".DB_NAME.";charset=".DB_CHARSET,
DB_USER, DB_PASSWORD, [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
]
);
} catch (Exception $ex) { die($ex->getMessage()); }
}
Help is greatly appreciated