0

I am getting this error trying to connect to DB,

having config.php file where pdo object is being created:

$pdo = new PDO($dsn, $user, $pass, $opt);   

after that inside the user.php I have a class stating the following:

require_once('config.php');
class USER {

    private $conn;          

    public function __construct($pdo) {     
        $this->conn = $pdo;

    }   

The object seems to be available inside the user.php file but not inside the class. Any suggestion how to overcome this ?

error is: Warning: Missing argument 1 for USER::__construct()

Thanks in advance.

John Siniger
  • 875
  • 2
  • 16
  • 39

0 Answers0