title: How to insert images in blob in mysql table using only sql syntax (without PHP)?
body: <ol>
  <li>Hi,I am new to SQL and I wanted to store images in the database.I already created a column with blob data type and tried to execute the following statement as given here</li>
  </ol>
  
  
  
  <pre><code>INSERT INTO `abc`
      (`img`)
      SELECT  
          BulkColumn FROM OPENROWSET(
              Bulk 'C:\Users\adity\Desktop\New folder\a.png', SINGLE_BLOB) AS BLOB
  </code></pre>
  
  <p>which gives error</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(
                    Bulk <code>C:\Users\name\Desktop\New folder\a.png</code>, SINGLE_BLOB) AS BLOB' at line 4 </p>
  </blockquote>
  
  <p>I also tried following code as given <a href="https://stackoverflow.com/a/8439229/2820063">here</a></p>
  
  <pre><code>insert into table `abc`(`img`) values('C:\Users\name\Desktop\New folder\an.jpg') where id=1;
  </code></pre>
  
  <p>which gives the error</p>
  
  <blockquote>
    <p>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table <code>abc</code>(<code>img</code>) values('C:\Users\adity\Desktop\New folder\an.jpg') where id=1' at line 1 </p>
  </blockquote>
  
  <p>So please suggest me how to store images in a blob without using php,etc and simply using simple sql insert statement.I am using wamp server for my database.</p>
  
  <ol start="2">
  <li>I know that I should use file system for images instead of using database.But what does a file system actually mean.Does it mean a file or image hosting site whose address will be stored in database.</li>
  </ol>