Error in findAll() method

public function findAll() {
    $stmt = $this->pdo->prepare('SELECT * FROM `' . $this->table . '`');
    $stmt->execute();

    return $result->fetchAll();
}

last line should read return $stmt->fetchAll();

there is no variable name $result


Link to content: PHP & MySQL: Novice to Ninja, 7th Edition - Section 8

Sounds like you answered you own question? It’s probably just a typo.

1 Like