title: php: reversing mysql_real_escape_string's effects on binary
body: <p>I built a webpage where users can submit a PDF which is then inserted into a MySQL database in a mediumblob for retrieval later.</p>
  
  <p>This all works fine, except when the PDF contains images or embedded fonts, in which case the images are corrupted and any text using the font disappears (Acrobat display a message about the missing font).</p>
  
  <p>I've determined the problem occurs from my passing the pdf data through the mysql_real_escape_string_function. I have switched to base64_encode/base64_decode on submission/retrieval which fixed the problem for all new files, but I have about 25 already submitted PDFs I need to be able to read.</p>
  
  <p>Is it possible to reversed the effects of mysql_real_escape_string? Or are these files damaged beyond repair?</p>