Changed database connection method from mysqli to PDO.