title: Insertion of image file to varbinary (max) field in ms sql server using php
body: <p>I am able to convert image to binary format</p>
  
  <pre><code>**&lt;?php
  //$id = $_GET[‘id’];
  //using sql query or other source get the dynamic image name or path
  $path = ‘../images/rose.jpg’;
  $size = GetImageSize($path);
  $mime = $size['mime'];
  $data=file_get_contents($path);
  header("Content-type: $mime");
   header('Content-Length: ' . strlen($data));
   echo $data;
  ?&gt;**
  </code></pre>
  
  <p>How can I insert the binary format in ms sql server 2005 using php</p>
  
  <p>Thanks for your time.</p>