Welcome Guest, Not a member yet? Register   Sign In
how can I return all users with names that DON'T begin with a letter?
#1

[eluser]got 2 doodle[/eluser]
The title says it all, I want to return all users that have chosen to have a user name that does not start with a letter.

This is used for a series of anchor's to allow selection of all users with names that start with A,B,C... etc.. Each anchor also has a count of the users within that letter group.

So in the controller I have A-Z working.

Code:
for ($i='65'; $i<='90'; $i++)
                    {
                    $letter = chr($i);
                    $temp = $this->band_data->count_where_bandname_starts_with($letter);
                    $data ['count_'] ["$letter"] = $temp;
                    }

in my model
Code:
function count_where_bandname_starts_with($letter = NULL){
      $query = $this->db->where('active = 1');
      $query = $this->db->where('group = 4');
     if($letter <> NULL){
     $query = $this->db->like('username', $letter,'after');
        }
    $query = $this->db->get($this->config->item('backendpro_table_prefix').'users');
    if ($query->num_rows() < 0){return '0'; } else { return $query->num_rows();} ;
}

So what can I do to get all the folks who use wierd names (these are names of musical groups)
like
1of_four or 2cool4words or whatever!

any help would be much appreciated

doodle


Messages In This Thread
how can I return all users with names that DON'T begin with a letter? - by El Forum - 07-23-2008, 12:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB