How to insert image in mysql database(table)?
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. Madhav Please try below code INSERT INTO xx_BLOB(ID,IMAGE) VALUES(1,LOAD_FILE('E:/Images/jack.jpg')); You should use LOAD_FILE like so: LOAD_FILE('/some/path/image.png') You can try something like this.. CREATE TABLE 'sample'.'picture' ( 'idpicture' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'caption' VARCHAR(45) NOT NULL, 'img' LONGBLOB NOT NULL, PRIMARY KEY('idpicture')) TYPE = InnoDB; or refer to the following links for tutorials and sample,