title: Insert PDF To my MSSQL Database
body: <p>i wanna Insert my PDF from $_FILES into my MSSQL Database(ERP system).
  So if i insert this i get following Error Message from the SQL Server:
  102 if i write if i write down :Dokument near the Cast and if i set it too ':Dokument' near the Cast then i get this error Type 002 (null) [0] (severity 0) [(null)] </p>
  
  <pre><code>                $filetemppath = $_FILES["_NDAUPLOAD"]["tmp_name"];
                  $filename = $_FILES["_NDAUPLOAD"]["name"];
                  $filesize = $_FILES["_NDAUPLOAD"]["size"]; 
  
                  $extract = fopen($filetemppath, 'r');
                  $content = fread($extract, $filesize);
                      // Überprüfe Upload
                      if(!get_magic_quotes_gpc()){
                          $filename = addslashes($filename);
                          $content = addslashes($content);
                      }
                  fclose($extract);
  
                  $docsql = "INSERT INTO DOKUMENT (Typ, Dateiname, Dokument, JournalID) VALUES (2, :Dateiname, (Cast (:Dokument AS varbinary(max))), NEWID()))";                  
                  $d = $db-&gt;prepare($docsql);
                  $d-&gt;bindParam(':Dateiname', $filename);
                  $d-&gt;bindParam(':Dokument', $content);
  
                  $de = $d-&gt;execute();
  </code></pre>