当我试图保存我的数据,然后每个图像保存在一个新行。我想通过内爆函数将所有图像URL保存在同一列中,但它不起作用。在我的模型中,我得到了$post\u图像作为一个数组
public function create_post($post_image){
$slug = url_title($this->input->post('title'));
$image = implode(',',(array)$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);
}
暂无答案!
目前还没有任何答案,快来回答吧!