SyntaxFix
Write A Post
Hire A Developer
Questions
Use this code:
$this->db->where(['id'=>2])->from("table name")->count_all_results();
or
$this->db->from("table name")->count_all_results();