I have a model function like following. When I click submit, all the data gets saved in the database, but the image field value is stored as Array,Array,Array.
How to solve this issue? I am a beginner with PHP and CodeIgniter.
public function create_post($post_image){
$slug = url_title($this->input->post('title'));
$image = implode(',',$post_image);
$data = array(
'title' => $this->input->post('title'),
'slug' => $slug,
'body' => $this->input->post('body'),
'category_id' => $this->input->post('category_id'),
'user_id' => $this->session->userdata('user_id'),
'post_image' => $image
);
return $this->db->insert('posts', $data);
}
print_r($post_image)and see what is showing... then copy those code and add it here. so we can find solution for you..$post_imageis.$post_imageis a$_FILESarray obviously.