<?php
class User{

    public static function getAll() {
        $query = "SELECT * FROM users ORDER BY Nom";
        $statement = Connection::getStatement($query);
        $statement->execute();
        return $statement->fetchAll();
    }
    
    public static function getByNom($nom) {
        $query = "SELECT * FROM users WHERE Nom=:nom";
        $statement = Connection::getStatement($query);
        $statement->bindParam(":nom", $nom);
        $statement->execute();
        return $statement->fetchAll();
    }

    
}