<?php
require_once __DIR__ . '/../functions.php';

class Category
{
    private $conn;

    public function __construct($conn)
    {
        $this->conn = $conn;
    }

    public function getAll()
    {
        $stmt = $this->conn->query("SELECT * FROM categories");
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
    }
    public function get($id)
    {
        $stmt = $this->conn->query("SELECT * FROM categories where id=$id");
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
    }


}
?>