Hello Guys, I have a Question, it possible storing image to dabase using blob in the Framework of CI? This is my Code in Controler.
function get_data_from_post(){
$data['page_headline'] = $this->input->post('page_headline',TRUE);
$data['page_title'] = $this->input->post('page_title',TRUE);
$data['keywords'] = $this->input->post('keywords',TRUE);
$data['description'] = $this->input->post('description',TRUE);
$data['page_content'] = $this->input->post('page_content',TRUE);
$imageName = $_FILES['featured_img']['name'];
$data['featured_img'] = $this->input->post(file_get_contents($_FILES['featured_img']['name']),TRUE);
return $data;
}
but when i run i got this,
A PHP Error was encountered
Severity: Notice
Message: Undefined index: featured_img
Filename: controllers/article.php
Line Number: 44
A PHP Error was encountered
Severity: Notice
Message: Undefined index: featured_img
Filename: controllers/article.php
Line Number: 45
A PHP Error was encountered
Severity: Warning
Message: file_get_contents(): Filename cannot be empty
Filename: controllers/article.php
Line Number: 45
what should i do? iam new in CI. Please help me. Thanks in Advance.