title: Converting files to blob to save in database
body: <p>I have an old user site that we are currently updating. The site's users have previously uploaded profile pics that are stored in a directory. I am now wanting to keep these profile images in the database, (easy to backup all data) but am having trouble working out how to do it.</p>
  
  <p>There are a lot of tutorials talking about do ing this from files that have just been uploaded and using the tmp name etc, but how can I re-create with files that have already been uploaded?</p>
  
  <p>I have looked into 
  <code>$data = file_get_contents($filename);</code>
  Which seems to create a binary file, but doesn't seem to save in database with:</p>
  
  <pre><code>mysql_query("UPDATE profiles SET company_logo = mysql_real_escape_string('".$data."') WHERE id = 1 ") or die(mysql_error());
  </code></pre>
  
  <p>*<strong><em>UPDATE</em>*</strong>
  So after looking into this some more, I think I will go with the majority and save the images as they already are... in folders..</p>