[eluser]Bart v B[/eluser]
You mean you can't populate youre database views into youre form?
hmm.. see more things what i should do diffrent..
Code:
<?php
function updateemployee()
{
// first load the Model
$this->load->model->('skillsmodel');
// then we can use a method..
$this->skillsmodel->updateemployee();
// everything ok redirect
redirect('index.php/skils/employee');
// header(“Location: http://localhost/aStage2CI/index.php/skills/employee”);
}
?>
// model
<?php
function updateemployee()
{
// first create a data array()
$data = array(
'empfirstname' => $this->input->post('empfirstname'),
'emplastname' => $this->input->post('emplastname')
);
// do the update on the table, with the data array()
$this->db->update('employee', $data);
// where he must update
$this->db->where($this->input->post('empid'));
}
<div id = “content”>
<h1 align=“center”><?php echo $pageheading; ?></h1>
<?php echo form_open('employee/updateemployee');?>
<?php echo form_hidden('empid',$this->uri->segment(3));?>
Employee First Name:
<?php foreach($query as $row)
{
?>
<input type="text" name="empfirstname" value="<?php echo $row->empfirstname;?>" /></p>
Employee Last Name:
<input type="text" name="emplastname" value="<?php echo $row->emplastname;?>" /></p>
Department:
<input type="text" name="deptid" value="<?php echo $row->emtid;?>" /></p>
<?php
}
?>
<input type=“submit” name=“submit” value=“submit”></p>
</form>
</div>
Whoops i made a little mistake i think, but it should be something like this.