public function add_from_sql($sql, $params) {
        global $DB;
        $userids = $DB->get_records_sql($sql, $params);
        if (!empty($userids)) {
            $this->userids = array_merge($this->userids, $userids);
        }
    }
public function add_from_sql($sql, $params) {
        global $DB;
        $userids = $DB->get_records_sql($sql, $params);
        if (!empty($userids)) {
            $this->userids = array_merge($this->userids, $userids);
        }
    }
public function add_from_sql ( $ sql , $ params ) { global $ DB ; $ userids = $ DB -> get_records_sql ( $ sql , $ params ) ; if ( ! empty ( $ userids ) ) { $ this -> userids = array_merge ( $ this -> userids , $ userids ) ; } }
Add sql and params to return user IDs.

@param string $sql The sql string to return user IDs.
@param array $params Parameters for the sql statement.
Add sql and params to return user IDs .