I am newbie in codeigniter. If I have a model like this :
public function get_data_for_reminder($id)
{
$this->db->select('nama_user, keluhan, email, addresed_to');
$query = $this->db->get_where('tbl_requestfix', array('id_request' => $id));
return $query->row();
}
And I try to accessed it from may controller :
public function reminderIT()
{
$id = $this->input->post('id');
$data = $this->model_request->get_data_for_reminder($id);
How can I generate the query results correctly?
EDIT Let's say I want to get the 'nama_user' into an a variable like this:
foreach ($data as $d) {
$name = $d['nama_user'];
}
echo json_encode($name);
I use firebug, it gives me null. I think my foreach is part of the problem.