PHP Designing Interfaces in PHP Introducing Interfaces Implement MySQL RepositoryInterface

Eric Drake
Eric Drake
Pro Student 6,256 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?


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);
      return $query->fetchAll(PDO::FETCH_OBJ);
    } catch (PDOException $e){