Php codeigniter中输入插入的空变量值

Php codeigniter中输入插入的空变量值,php,mysql,codeigniter,codeigniter-3,Php,Mysql,Codeigniter,Codeigniter 3,在我的$imageencode变量中,我将获得一个图像的二进制代码,我想将它插入一个名为image的blob类型字段上名为images\u from\u balance的mysql表中 我认为这是我的数组格式的一个问题,即来自html表单输入的数组,但我不知道如何使该数组插入我的变量 这是我的错误,我得到: 发生数据库错误 错误号码:1048 列“image”不能为空 从_balance(图像)将值(空)插入到图像中 更新 $imageencode = $this->curl-&g

在我的$imageencode变量中,我将获得一个图像的二进制代码,我想将它插入一个名为image的blob类型字段上名为images\u from\u balance的mysql表中

我认为这是我的数组格式的一个问题,即来自html表单输入的数组,但我不知道如何使该数组插入我的变量

这是我的错误,我得到:

发生数据库错误

错误号码:1048

列“image”不能为空

从_balance(
图像
)将值(空)插入到图像中

更新

    $imageencode = $this->curl->simple_get($reqUrl);

    $data = array(  
            'image' => $this->input->post('imageencode')
            );
    $this->db->insert('images_from_balance',$data);
与:

更新

    $imageencode = $this->curl->simple_get($reqUrl);

    $data = array(  
            'image' => $this->input->post('imageencode')
            );
    $this->db->insert('images_from_balance',$data);
与:


请看您的数据库结构,这里有您不允许的空值filed@Tatu你们能用$imageencode返回的内容更新这个问题吗???@Gulshan我看到你们删除了你们的帖子,$imageencode返回了一个与图像对应的长二进制代码。@TatuBogdan是数组中的值??否,它就像一个长字符串,我也可以对它进行base64编码filed@Tatu你能用$imageencode返回的内容更新问题吗???@Gulshan我看到你删除了你的帖子,$imageencode正在返回一个与图像对应的长二进制代码。@TatuBogdan是数组中的值??不,它就像一个长字符串,我也可以对它进行base64编码。这很有效!从我的角度来看,这是一个语法问题,这是propper-way:$data=array('image'=>$imageencode);这工作!从我的角度来看,这是一个语法问题,这是propper-way:$data=array('image'=>$imageencode);
$imageencode = $this->curl->simple_get($reqUrl);
$data = array( 'image' => $imageencode);