title: Insert image in database as blob type - Codeigniter
body: <p>I need to store the image as blob type in database using codeigniter. I don't want to upload the image in a folder. I just wanted to store the image in db as  blob. </p>
  
  <p>I have this in my model   </p>
  
  <pre><code> public function insert_user()
   {    
      $get_image = $this-&gt;input-&gt;post(file_get_contents($_FILES['imgProfile']['tmp_name']));  //imgProfile is the name of the image tag  
      $insert_values = array(
              'first_name' =&gt; $this-&gt;input-&gt;post('FirstName'),
              'last_name' =&gt; $this-&gt;input-&gt;post('LastName'),
              'profile_image' =&gt; $this-&gt;$get_image 
              );  
  
      $insert_qry = $this-&gt;db-&gt;insert('user', $insert_values);    
      }
  </code></pre>
  
  <p>My controller contains </p>
  
  <pre><code>public function new_user()
  {
          $this-&gt;user_model-&gt;insert_user(); //user_model is the model name
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Fatal error: Cannot access empty property in C:\xampp\htdocs\CI\system\core\Model.php on line 52
  </code></pre>
  
  <p>Thanks.</p>