FORM INPUT Help value !!
// this is just a refrence from $ nm and $ fid from test_model //
$data['fid']['value'] = 0;
$data['nm'] = array('name'=>'fname',
'id'=>'id');
Let's say I have one form_view with
<?=form_label('Insert Your Name :')?>
<?=form_input($nm)?>
and function to get one line
function get($id){
$query = $this->db->getwhere('test',array('id'=>$id));
return $query->row_array();
}
then in the controller .. index ($ id = 0)
and somewhere in the index
if((int)$id > 0)
{
$q = $this->test_model->get($id);
$data['fid']['value'] = $q['id'];
$data['nm']['value'] = $q['name'];
}
and the mysql table has something like 1. victor, 2. visible, etc. as the name value
but here it does not take the name and id value from form_input and does not show it again in form_view in the same input field as the winner, etc., so update and send it back to the database ...
help anyone !! and please be easy as I am new to CI !!
source
share