[eluser]Thorpe Obazee[/eluser]
Anyway, I modified my code like this to get it. If anyone has a better way... don't hesitate :p
Code:
function _save_ad($ad_id = FALSE)
{
$ad_data = array(
'title' => $this->input->post('title'),
'user_id' => $this->session->userdata('user_id'),
'cat_id' => $this->input->post('cat'),
'tags' => $this->input->post('tags'),
'price' => $this->input->post('price'),
'desc' => $this->input->post('desc'),
'floor_flat' => $this->input->post('floor_flat'),
'building' => $this->input->post('building'),
'street_district' => $this->input->post('street_district'),
'zone' => $this->input->post('zone'),
'date_add' => date("Y-m-d H:m:s")
);
if ($_FILES)
{
$ad_data['image'] = $this->file['file_name'];
$ad_data['image_thumb'] = $this->file['raw_name'].'_thumb'.$this->file['file_ext'];
}
$this->ads_model->save_ad($ad_data, $ad_id);
$this->session->set_flashdata('message', $this->lang->line('ad_saved'));
}