php - check $this->db->get() is empty or not -
i'm using codeigniter
framework.
how can check get
function empty or not?
... $result = $this->db->get() //how check $result empty or not ?
you can way
$query = $this->db->get(); if ($query->num_rows() > 0) { //record exists - hence fetch row $result = $query->row(); } else { //record not exists }
Comments
Post a Comment