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

[eluser]got 2 doodle[/eluser]
Ya thanks, I saw the NOT LIKE syntax, I have achieved the desired result with this code

In a model file
Code:
function count_where_bandname_starts_num(){
/* get all the band names */
    $query = $this->db->where('active = 1');
       $query = $this->db->where('group = 4');
       $query = $this->db->get($this->config->item('backendpro_table_prefix').'users');
    if ($query->num_rows() < 0){$all = NULL; } else { $all = $query->num_rows();} ;
    if (!$all) { return 0; } else {
    $bucket = 0;
            for ($i='65'; $i<='90'; $i++)
                        { $scoop = $this->count_where_bandname_starts_with(chr($i));
                          $bucket = $bucket + $scoop;
                        }
    }                        
    return $all - $bucket;
}

So this returns everthing that doesn't fit in the other user groupings (which is what I want).

But I wonder if my hack style is missing a key feature in mysql or php or CI?

Anything like matching for [A-Z] ?? like a regex

Thanks,
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:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB