public function update($params, $id)
    {
        if (is_array($params)) {
            foreach (array_keys($params) as $key => $value) {
                $paramsRules = [$value => ['required' => true]];
            }
            $paramsValidate = new Validation($params, $paramsRules);
            if ($paramsValidate->fail()) {
                Error::set($paramsValidate->error()->get());
            }
        }
        if ($this->fail() !== true) {
            $fields = [
                    'db_name' => __config()->auth->db_name,
                    'table'   => __config()->auth->db_table,
                    'columns' => $params,
                    'wheres'  => ['id = '.$id],
                ];
            $db = new DB();
            $db->db()->update($fields);
            $db->db()->close();
            Success::set(__printl('auth:success:update'));
        }
    }
public function update($params, $id)
    {
        if (is_array($params)) {
            foreach (array_keys($params) as $key => $value) {
                $paramsRules = [$value => ['required' => true]];
            }
            $paramsValidate = new Validation($params, $paramsRules);
            if ($paramsValidate->fail()) {
                Error::set($paramsValidate->error()->get());
            }
        }
        if ($this->fail() !== true) {
            $fields = [
                    'db_name' => __config()->auth->db_name,
                    'table'   => __config()->auth->db_table,
                    'columns' => $params,
                    'wheres'  => ['id = '.$id],
                ];
            $db = new DB();
            $db->db()->update($fields);
            $db->db()->close();
            Success::set(__printl('auth:success:update'));
        }
    }
public function update ( $ params , $ id ) { if ( is_array ( $ params ) ) { foreach ( array_keys ( $ params ) as $ key => $ value ) { $ paramsRules = [ $ value => [ 'required' => true ] ] ; } $ paramsValidate = new Validation ( $ params , $ paramsRules ) ; if ( $ paramsValidate -> fail ( ) ) { Error :: set ( $ paramsValidate -> error ( ) -> get ( ) ) ; } } if ( $ this -> fail ( ) !== true ) { $ fields = [ 'db_name' => __config ( ) -> auth -> db_name , 'table' => __config ( ) -> auth -> db_table , 'columns' => $ params , 'wheres' => [ 'id = ' . $ id ] , ] ; $ db = new DB ( ) ; $ db -> db ( ) -> update ( $ fields ) ; $ db -> db ( ) -> close ( ) ; Success :: set ( __printl ( 'auth:success:update' ) ) ; } }
Update the users.

@param (array) $params fields like  [name => thisname]
@param (int)   $id     id of user

@since 2.0.3

@return void
Update the users .