Welcome Guest, Not a member yet? Register   Sign In
Echo a single entry from a single DB returned array.
#3

[eluser]mflammia[/eluser]
Thank for replying and pointing me in the right direction - had looked there many times but it just did not make sense to me. Took me a while and learnt something new in the process, thanks.

For anyone else having the same problem this is what I did.

In my model

Code:
function get_person(){
            $query = $this->db->query('SELECT * FROM person WHERE id_person='.$this->uri->segment(3));
            return $query->row();
        }

In my controller

Code:
function get_records_edit(){
                //$this->load->model('site_model');
                $data['person'] = $this->site_model->get_person();
return $data;
        }

In my view i simpely do the following

Code:
<?php echo $person->first_name ?>
<?php echo $person->second_name ?>


Messages In This Thread
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 10:52 AM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 12:44 PM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 01:45 PM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 02:42 PM
Echo a single entry from a single DB returned array. - by El Forum - 04-06-2012, 04:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB