Welcome Guest, Not a member yet? Register   Sign In
A Database Error Occurred You must use the "set" method to update an entry.
#2

[eluser]pistolPete[/eluser]
Do you want to update an existing entry or add a new one?

Don't use this:
Code:
$this->db->insert('avatars',$_POST);

Build the insert array by hand:
Code:
$data = array();
$data['firstname'] = $this->input->post('firstname');
$data['lastname'] = $this->input->post('lastname');
$data['id'] = $this->input->post('id');

(...)

// if you want to insert a NEW entry
$this->db->insert('avatars', $data);

// if you want to update an EXISTING entry
$this->db->where('id', $data['id']);
$this->db->update('avatars', $data);

Btw: I'd recommend using the Form validation to repopulate form: User Guide


Messages In This Thread
A Database Error Occurred You must use the "set" method to update an entry. - by El Forum - 03-15-2009, 07:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB