Welcome Guest, Not a member yet? Register   Sign In
Update some content
#5

[eluser]LuckyFella73[/eluser]
In your edit form you need a hidden form field
and set the value equal to the id of the record
you are editing.

When calling the update method (after submitting the form)
you need a line like:
Code:
$tables['id'] = $this->input->post('row_id');
// assuming your hidden field has the name "row_id" in this example

Otherwise your model doesn't know which row has to be updated.

If you modify your script like that the update method from your model
should work like you tried inbetween and samitrimal suggested:
Code:
function update($tables){
    
    
      $this->db->where('id', $this->uri->segment(3));
      $this->db->update('data', $tables);
  }


Messages In This Thread
Update some content - by El Forum - 06-05-2011, 09:29 PM
Update some content - by El Forum - 06-05-2011, 11:29 PM
Update some content - by El Forum - 06-06-2011, 08:12 AM
Update some content - by El Forum - 06-06-2011, 08:17 AM
Update some content - by El Forum - 06-06-2011, 08:54 AM
Update some content - by El Forum - 06-06-2011, 09:53 AM
Update some content - by El Forum - 06-06-2011, 10:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB