message implode()在codeigniter中传递的参数无效

ecfdbz9o  于 2021-06-24  发布在  Mysql
关注(0)|答案(0)|浏览(108)

当我试图保存我的数据,然后每个图像保存在一个新行。我想通过内爆函数将所有图像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);
    }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题