-1
我需要使用codeigniter将图像作为Blob类型存储在数据库中。我不想将图片上传到文件夹中。我只是想将图像作为blob存储在数据库中。以blob类型在数据库中插入图像 - Codeigniter
我有这个在我的模型
public function insert_user()
{
$get_image = $this->input->post(file_get_contents($_FILES['imgProfile']['tmp_name'])); //imgProfile is the name of the image tag
$insert_values = array(
'first_name' => $this->input->post('FirstName'),
'last_name' => $this->input->post('LastName'),
'profile_image' => $this->$get_image
);
$insert_qry = $this->db->insert('user', $insert_values);
}
我控制器包含
public function new_user()
{
$this->user_model->insert_user(); //user_model is the model name
}
错误:
Fatal error: Cannot access empty property in C:\xampp\htdocs\CI\system\core\Model.php on line 52
感谢。
什么是Model.php中的L52? – Florian
参考$ this - > $ getimage是错误的,它应该是$ this-> getimage或者简单的$ getimage(在本地函数中使用) –