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

[eluser]jcopling[/eluser]
well, there does not appear to be anything in the DB Active Record class to provide you with anything like does_not_start_with, however you can achieve the same thing by using the standard where function like this:
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->where("username NOT LIKE '$letter%'");
      }
      $query = $this->db->get($this->config->item('backendpro_table_prefix').'users');
      if ($query->num_rows() < 0){return '0'; } else { return $query->num_rows();} ;
}

Hope that helps.


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:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB