繁体   English   中英

来自codeigniter中的输入插入的NULL变量值

[英]NULL variable value from a input insert in codeigniter

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

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

在我的$ imageencode变量中,我将得到一个图像的二进制代码,我想在名为image的blob类型字段的一个名为images_from_balance的mysql表中插入它。

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

这是我得到的错误:

发生数据库错误

错误号码:1048

列'image'不能为null

INSERT INTO images_from_balanceimage )VALUES(NULL)

更新

$imageencode = $this->curl->simple_get($reqUrl);
$data = array( 'image' => $this->input->post('imageencode'));

附:

$imageencode = $this->curl->simple_get($reqUrl);
$data = array( 'image' => $imageencode);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM