function __construct() { parent::__construct(); $sql = "SELECT * FROM categories"; $stmt = $this->conn->query($sql); $this->categories = $stmt->fetchAll(PDO::FETCH_ASSOC); }