[Solved] Conditional fetching data from a table


In Your model add this method:

    public function getINFO(){

    $query = $this->db->get_where('usuarios', array('id' => $this->session->userdata('id')));
    if ($query->num_rows() > 0 ) {
        return $query->row_array();
    }
}

See this link for more :

https://www.codeigniter.com/user_guide/database/results.html#result-arrays

18

solved Conditional fetching data from a table