How to insert image in mysql database(table)?

Viru picture Viru · Feb 5, 2013 · Viewed 229.6k times · Source

I want to insert image into a table like

 CREATE TABLE XX_SAMPLE(ID INT
                       ,IMAGE BLOB);

So can you help out form how to insert image into the above table.

Answer

Madhav picture Madhav · Feb 5, 2013

Please try below code

INSERT INTO xx_BLOB(ID,IMAGE) VALUES(1,LOAD_FILE('E:/Images/jack.jpg'));