Hi All I'm new to Codeigniter, I'm trying to get all data relating to the account_id passed from a previous page.
I'm passing the account_id but not passing the name field associated with the account_id. The name field is blank.
I'm getting an error:
Here is my code for the controller:
function input($account_id = '', $name = ''){
if((int)$account_id > 0){
$query = $this->db->select('name', $name);
$query = $this->db->get_where('db_accounts', array('account_id' => $account_id));
$data['account'] = $query;
$data['fname']['value'] = $name;
$data['faccount_id']['value'] = $account_id;
$data['name'] = '';
$data['account_id'] = '';
}
$this->load->view('manage/input',$data);
}
Here is my input view form:
<?php
$data = array(
'name' => $fname['value'],
'account_id' => $faccount_id['value']
);
echo '<form action="/manage/edit" method="post" accept-charset="utf-8">';
echo form_hidden($data);
echo $account_id .' Account ID'.
form_input($faccount_id);
echo $name .' Name'.
form_input($fname);
$data = array('name' => 'submit', 'value' => 'Update Account', 'class' => 'submit');
echo form_submit($data);
?>
<?php echo form_close(); ?>