updated db.php

Created public function __construct with PDO connection