PHP Designing Interfaces in PHP Introducing Interfaces Implement MySQL RepositoryInterface

Eric Drake
PRO
Eric Drake
Pro Student 5,874 Points

This challenge never specifies a host or database name to which to connect. Did I miss something?

Does anyone have the proper dsn value that I should pass into the PDO constructor?

sqlRepository.php
<?php

class sqlRepository extends PDO implements RepositoryInterface {
  public function all($table){
    try {
      $db = new PDO('mysql:dbname=smellmyfarts;host=localhost;', 'root', 'password');
      $query = $db->prepare('select * from ' . $table);
      $query->execute();
      return $query->fetchAll(PDO::FETCH_OBJ);
    } catch (PDOException $e){
      die($e->getMessage());
    }

  }
}