I have this issue, I want to fill a form from a variable, what i'm doing right now is passing ID through an anchor on the view, here's the sample
//view search
<?php echo anchor('rfi/addNotification/'.$ID,'Add Notification',array('class'=>'add')); ?>
This calls a function on my controller
function addNotification(){
$id = $this->input->post('ID');
$data['results'] = $this->my_model->addTicket($id);
$this->load->view('ticketAdd',$data);
}
And the model
function addTicket($id)
{
if (!empty($id){
$this->db->like('ID', $id);
$query = $this->db->get($this->Table2);
return $query->result();
}else {
echo 'No results to display';
}
}
But Im not getting any results. I want to prefill some fields, because later I want to save that data on table1