How to find the number of occurances of open_id_fk in this table. I am using the below code in my model.
$this->db->select('open_id_fk, COUNT(open_id_fk) as total');
$this->db->group_by('open_id_fk');
$this->db->order_by('total', 'desc');
$query = $this->db->get('voting_ip', 10);
return $query;
I am not getting proper output. the output is:
116 6
118 3
119 2
HTML
<div id="openletter" style="color:black;font-family:'Lato',sans-serif;"> <br>
<?php echo "<br><br>".$row->open_id_fk;?><?php echo $row->total; ?>