<?php
class Champ {
    public static function getChampsByNoTable($noTable) {
        $query = "SELECT * FROM champs WHERE NoTable=:notable ORDER BY NoChamp";
        $statement = Connection::getStatement($query);
        $statement->bindParam(":notable", $noTable);
        $statement->execute();
        return $statement->fetchAll();
    }

    public static function getChampsByNoTableAndNoChamp($noTable, $noChamp) {
        $query = "SELECT * FROM champs WHERE NoTable=:notable AND NomChamp=:nochamp";
        $statement = Connection::getStatement($query);
        $statement->bindParam(":notable", $noTable);
        $statement->bindParam(":nochamp", $noChamp);
        $statement->execute();
        return $statement->fetch();
    }
}