I'm sorry I have a question, I want to get data from query and send it to view.. Here's my code..
$this->load->model('expert_model');
$data = $this->expert_model->get_result($consultation_id);
$datas = $this->db->select('*')->limit(1)->order_by('CF_Combine', 'DESC')->get_where('hasil', ['id_konsultasi' => $consultation_id])->row();
$this->load->view('User/value', $datas);
I have tried dump the $datas and the result is all I want. But, How can I get data from $datas to the User/value's view ? I tried to use $datas but it said undefined 'datas'
I'm sorry I really bad both in english and code :(
And here's my code in view, just want to see it works or not
<?php foreach ($datas as $key) : ?>
<?php echo number_format(($key->CF_Combine * 100), 2) . " %" ?>
<?php endforeach ?>