[eluser]the_unforgiven[/eluser]
Hi All,
I have a upload box in a form and everything is fine, but if i just update the textarea then save it, it removes the PDF i previously uploaded, i presume an IF statement will do this but what should I write Im not quite sure?
Here's my update function in my model:
Code:
function updateMemberpage()
{
$data = array(
'title' => $this->input->post('title'),
'body' => $this->input->post('body'),
'status' => $this->input->post('status')
);
$image_data = $this->upload->data();
$data['file'] = $image_data['file_name']; // This is where i need it state if nothing is entered in the upload leave the previous file there until something new is uploaded.
$this->db->where('status', 'Active');
$this->db->update('memberpage', $data);
}