[eluser]Unknown[/eluser]
i tried to retrieve data from databases and show it on my dropdown menu, but i got this error
Quote:Fatal error: Call to undefined method Reg_model::get_sec() in C:\xampp\htdocs\careercenter\system\application\controllers\registration.php on line 148
can somebody help me with this error???
this is my code
controller:
Quote:function register_emp{
$this->load->model('reg_model');
$data['get_sector'] = $this->reg_model->get_sec('id','sec_name','sector');
$this->load->view('emp_reg_view', $data);
}
model:
Quote:function get_sec($id, $name, $from){
$result = array();
$result_key = $this->db->query('select '.$id.', '.$nama.' from '.$from.' order by '.$id.' asc');
foreach($result_key->result()as $row)
{
$result[$row->$id]= $row->$id .'-'. $name;
}
return $result;
}
view:
Quote:<?php echo form_dropdown('ind_sec', $nama, set_value('ind_sec', $id)); ?>
i already use the code from my controller above on my previous function, almost same, just parameter difference and its works.
please help, this is for my final project
x_X