-1

error in

INSERT into 'cd' (`id`,`image`) 
VALUES ('1',LOAD_FILE('image/1.png')) == ----> 

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 ''cd' (`id`,`image`) VALUES ('1',LOAD_FILE('image/1.png'))' at line 1

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160

1 Answers1

1

You should use backticks instead of quotes ' around your tablename (cd)

Backticks are most likely to be find on the top left of your keyboard (above the TAB), but this can be different for different keyboard-layouts.

RichardBernards
  • 3,146
  • 1
  • 22
  • 30
  • The OP already used the backtick for the columns, you can assume he knows where it is. – Gerald Schneider Nov 24 '14 at 09:52
  • @GeraldSchneider Not really... Could be he is editing existing code and copied the backtick... My clarification is also there for other people looking for an answer to this question, so they know where to find it ;) – RichardBernards Nov 24 '14 at 09:53
  • still got an error image cannot be null – Hari Prasad Nov 24 '14 at 10:11
  • Than MySQL probably can't located the imagefile in question `image/1.png`. The relative path probably can't be found, so try to use an absolute path to the image. – RichardBernards Nov 24 '14 at 10:13