title: read pdf content from BLOB in MySQL
body: <p>i have developed a system which parses and stores emails into a MySQL database.
  I save the attachments as an array of objects in JSON into a MEDIUMBLOB field.
  Everything works almost as expected. At least when saving.
  When i try to read the attachments i only get back the images, but not the pdf file.</p>
  
  <p>The BLOB has the following 'dummy' content:</p>
  
  <pre><code>[
  {
  "filename":"img1.png", "ext":"png", "type": "image/png", "size":4096, 
  "dispo":"inline", "cid":"123@abc", "content":"base64_encoded binary- 
  data"
  },
  {
  "filename":"pdf1.pdf", "ext":"pdf", "type": "application/pdf", 
  "size":4096, "dispo":"attachment", "cid":null, 
  "content":"base64_encoded binary-data"
  }
  ]
  </code></pre>
  
  <p>The attachments are written as follows:
  json_encode($attachmentsDB,JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).</p>
  
  <p>I debugged, but somehow when i fetch data BLOB from the DB - in this case - the last element = the pdf-file is not returned. Only the preceding image files.</p>
  
  <p>When i hardcode the data and try my code it works perfectly.
  The data isn't truncated either.</p>
  
  <p>It seems that it's not a memory problem</p>
  
  <p>If anybody could give me a hint please... ?</p>
  
  <p>Many thanks in advance</p>