I'm building this website with PDO and Pattern MVC.  I'm currently working on the login page and would like to know if this structure is correct for MVC pattern.  I'd also like your opinions and advice on this.For my login view I have:<form action=test.php name=loginform method=post>    <input type=text name=login>    <input type=password name=password>    <input type=submit name=login_submit value=Se connecter></form>For my login controller I have:if(isset($_POST['login_submit'])){    if(!empty($_POST['login']) && !empty($_POST['password'])){        $auth = new auth();        $auth->setLogin($_POST['login']);        $auth->setPassword(md5(sha1($_POST['password'])));        if(($row = $auth->login('u_login,u_email,u_id_level', 'users', 'u_login', 'u_password'))){                             $_SESSION['back_office'] = array(                'login' => $row->u_login,                'email' => $row->u_email,                'level' => $row->u_id_level            );        }else{            message::showError('Compte non reconnu');        }    }else{        message::showError('Veuillez remplir tous les champs');    }}For my login model I have:class auth{    protected $rowUser;    protected $login;    protected $password;    protected $email;    public function setLogin($login){        $this->login = $login;    }    public function setPassword($password){        $this->password = $password;    }    /**     * @return array $row     */    public function login($fields, $table, $col_login, $col_password){        $query = Db::getInstance()->prepare('SELECT '.$fields.' FROM '.$table.' WHERE '.$col_login.' = :login AND '.$col_password.' = :password');        $query->bindValue(':login',$this->login,PDO::PARAM_STR);        $query->bindValue(':password',$this->password,PDO::PARAM_STR);        $query->execute();        if($query->rowCount() > 0){            $row = $query->fetch();            return $row;        }else{            return false;        }        $query->closeCursor();    }    }
Look over my code for PDO and MVC
php;object oriented;mysql;mvc;pdo
Just a minor note: I'd reverse some conditions and use guard clauses to make the code flatten.if(empty($_POST['login']) || empty($_POST['password'])){    message::showError('Veuillez remplir tous les champs');    return;}$auth = new auth();$auth->setLogin($_POST['login']);$auth->setPassword(md5(sha1($_POST['password'])));if(!($row = $auth->login('u_login,u_email,u_id_level', 'users', 'u_login', 'u_password'))){                     message::showError('Compte non reconnu');    return;}$_SESSION['back_office'] = array(    'login' => $row->u_login,    'email' => $row->u_email,    'level' => $row->u_id_level);(You might need to extract this out to a function.)References: Replace Nested Conditional with Guard Clauses in Refactoring: Improving the Design of Existing Code by Martin Fowler; Flattening Arrow Code