Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function all_polling() {
- $this->db->select('*');
- $this->db->from('micom_pools');
- $this->db->limit(1);
- $this->db->where('status','published');
- $this->db->order_by('id','desc');
- $query = $this->db->get();
- return $query->result_array();
- }
- public function polling_sum($id==NULL){
- $this->db->select('count(*) as jml_vote ');
- $this->db->from('micom_votes');
- if($id!=NULL){
- $this->db->where('pool_id',$id);
- }
- $query = $this->db->get();
- return $query->result_array();
- }
- public function jum_vote($id,$answer){
- $this->db->select('count(*) as jum');
- $this->db->from('micom_votes');
- $this->db->where(array('pool_id'=>$id,'answer_id'=>$answer));
- $query = $this->db->get();
- return $query->result_array();
- }
Advertisement
Add Comment
Please, Sign In to add comment