html - how to make this sql statment in codeigniter framework php? -


how make sql statment in codeigniter framework php??

select count(`id`) `c` `products` `valid` = 1 , `sticky` = 2 

how make in model

like way

$this->db->get('products'); 

how that?

 $this->db->select('count("id") c'); $this->db->where('valid',1); $this->db->where('sticky',2); $result = $this->db->get('products'); 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -