I am currently using Codeigniter. As shown below, a query looks up for the count of rows and then sent it to the view. However, the view does not shows the actual count. The actual count on DB (InnoDB) is 1001 but displays up to 1000 on my view. Any ideas?
Model:
public function check_source_email($location)
{
$query = "SELECT COUNT(*) as row_count FROM feedback WHERE location = '$location' AND source_lead = 'Email' ";
$count = $this->db->query($query)->result();
return $count[0]->row_count;
}
Controller:
$data['email'] = $this->Stats->check_source_email($location);
View:
<strong>Email Listing</strong>
<span class="pull-right"><?php echo $email; ?></span>
Use num_rows:
public function check_source_email($location){
$query = $this->db->get_where('feedback',array('location'=>$location,'source_lead'=>'Email'));
return $query->num_rows();
}