⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

count call_back column



DREON
  • profile picture
  • Member

Posted 29 April 2013 - 04:07 AM

 hi masters i have a question i use below code to count the row of my table

the result is show on my gc table its 348..


but all my rows is result is 348..


example my gc table:


 faculty |


348


348


348


348


to


348

row


 


i want the result is only


faculty


348


 


$crud->callback_column('Faculty',array($this,'faculty'));

 


public function faculty($value, $row)



$this->db->where('classification', 'faculty');


        $this->db->from('offices');


        return $this->db->count_all_results();



                            
                       

 

 


DREON
  • profile picture
  • Member

Posted 29 April 2013 - 05:28 AM

solve my proble, i create a table with one column only...

 

then add this call_back column

 

public function faculty($value, $row)




$this->db->where('classification', 'faculty');



        $this->db->from('offices');



        return $this->db->count_all_results();