Check login and redirect in Codeigniter not working
This is because num_rows()
is not a part of query builder functions. You can try to use this to count your result:
$this->db->count_all_results()
Refer to - https://www.codeigniter.com/user_guide/database/query_builder.html#limiting-or-counting-results
If this solves your answer, please mark this as answer. Thanks!
use
$query = $this->db->query("YOUR QUERY");$row = $query->row();if (isset($row)){ echo $row->title; echo $row->name; echo $row->body;}