Is it possible to store images in SQLlite.
If so does anyone have the code to insert an image into a table.
Cheers
SteveW [import]uid: 4585 topic_id: 11664 reply_id: 311664[/import]
Is it possible to store images in SQLlite.
If so does anyone have the code to insert an image into a table.
Cheers
SteveW [import]uid: 4585 topic_id: 11664 reply_id: 311664[/import]
You can store images.
from the sqlite site
(10) Does SQLite support a BLOB type?
SQLite versions 3.0 and later allow you to store BLOB data in any column, even columns that are declared to hold some other type.
I am using :
local imagename = “coffee1.png”
local addimage2 =[[INSERT INTO test (id,title,subtitle) VALUES (NULL,“testtoput”,]]…imagename…[[)]] (title & subtitle are text fields)
db:exec( addimage2 )
print(addimage2)
this results in :
INSERT INTO test (id,title,subtitle) VALUES (NULL,“testtoput”,coffee1.png)
I have also tried :
INSERT INTO test (id,image,image2) VALUES (NULL,“testtoput”,coffee1.png) (image is a text field and image2 is an object field)
This does not insert a new record. I do not get any errors in the terminal window.
I have the connections working as I can use :
local tablefill =[[INSERT INTO test (id,title,subtitle) VALUES (NULL, ‘]]…testvalue[1]…[[’,’]]…testvalue[2]…[[’);]]
Any help appreciated
SteveW [import]uid: 4585 topic_id: 11664 reply_id: 42625[/import]