Codeigniter Get Num Rows

[Solved] Codeigniter Get Num Rows | Php - Code Explorer | yomemimo.com
Question : codeigniter get num_rows

Answered by : lokesh-ramchandani-in6l3jq294i2

// num rows example
$this->db->select('*');
$this->db->where('whatever');
$query = $this->db->get('table');
$num = $query->num_rows();

Source : | Last Update : Thu, 19 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 get num rows

Code Explorer Popular Question For Php