Codeigniter Count Rows

[Solved] Codeigniter Count Rows | Php - Code Explorer | yomemimo.com
Question : row count in codeigniter

Answered by : rich-rhinoceros-v28rvqt49doj

$this->db->where('EmpID >=', 5);
$query = $this->db->get('Employees');
echo $query->num_rows();
// Outputs, 4

Source : https://www.kodingmadesimple.com/2016/08/codeigniter-count-query-results-number-of-rows-in-table.html | Last Update : Sun, 03 Jan 21

Question : count all results codeigniter

Answered by : difficult-dormouse-jzjf2qw7on1u

$this->db->select('id');
$this->db->from('table');
$this->db->where($your_conditions);
$num_results = $this->db->count_all_results();

Source : https://stackoverflow.com/questions/14204691/codeigniter-count-all-results | Last Update : Tue, 26 May 20

Question : get result count codeigniter

Answered by :

public function record_count() { return $this->db->count_all("tablename");
}

Source : | Last Update : Mon, 09 Nov 20

Question : codeigniter count rows

Answered by : matteo-puppis

$this->db ->where(['field'=>'foo']) ->from("tablename") ->count_all_results();
//OR
$this->db ->where(['field'=>'foo']) ->count_all_results("tablename");

Source : | Last Update : Fri, 28 Feb 20

Question : get number of rows in codeigniter model

Answered by : ankur-prajapati

function data_model() { $this->db->select('*'); $this->db->from('news_data'); $id = $this->db->get()->num_rows(); return $id;
}

Source : https://stackoverflow.com/questions/28958307/php-codeigniter-count-rows/28958771 | Last Update : Mon, 25 Oct 21

Answers related to codeigniter count rows

Code Explorer Popular Question For Php