connect to db using PDO class for best practice