SQLite Forum

How to READ and WRITE an image to an SQLITE BLOB FIELD
Login
I have an existing web application that uses an SQLITE database and PHP coding which works GREAT !!!

I now need to SAVE images to my SQLITE database.
I added a BLOB field type and I am able to easily SAVE and EXPORT an image file using the DB Browser application.

I found the following reference on the "sqlite.org" website which explains how to READ and WRITE an image file to an SQLITE database, however, I am having trouble getting it to work.

Click here for the link: Reference Material
https://www.sqlite.org/cli.html#fileio

Mostly confused by the terminology in the following:
"name TEXT"
"type TEXT"
"img BLOB"

sqlite> INSERT INTO images(name,type,img)
   ...>   VALUES('icon','jpeg',readfile('icon.jpg'));

Creates TABLE:
sqlite> CREATE TABLE images(name TEXT, type TEXT, img BLOB);

INSERTS JPEG image from an external file into an SQLITE database.
sqlite> INSERT INTO images(name,type,img)
   ...>   VALUES('icon','jpeg',readfile('icon.jpg'));

EXPORTS an image from an SQLITE database 
sqlite> SELECT writefile('icon.jpg',img) FROM images WHERE name='icon';

I would appreciate any help I can get in coding this using PHP..