public function open_connection() { // Look for custom names first, then fall back to standard DB_* names $host = defined('server') ? server : (defined('DB_SERVER') ? DB_SERVER : (defined('DB_HOST') ? DB_HOST : 'localhost')); $dbname = defined('database_name') ? database_name : (defined('DB_NAME') ? DB_NAME : ''); $dbuser = defined('user') ? user : (defined('DB_USER') ? DB_USER : ''); $dbpass = defined('pass') ? pass : (defined('DB_PASS') ? DB_PASS : ''); if (empty($dbname) || empty($dbuser)) { die("Database configuration error: Please check that your database credentials (host, user, password, database name) are defined in config.php."); } try { $this->conn = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8mb4", $dbuser, $dbpass); $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { die("Problem in database connection! " . $e->getMessage()); } }Database configuration error: Constants 'server', 'database_name', 'user', 'pass' are not defined in config.php.