0
Can we access a image from database without the image in any folder
2 Answers
+ 2
Yes, you can store images in a database as a blob as far as I know. Not recommended for a large database of photos.
Hope this helps
Edit: based on your second question how to insert it into the database there's basically two ways, but what you probably want is the following:
INSERT INTO MY_TABLE(id, blob_col) VALUES(1, LOAD_FILE('/full/path/to/file/myfile.png')
That's based on what I found here: http://stackoverflow.com/a/18082149/4103154
Or if running from PHP you could implement the following somehow:
$sql = "INSERT INTO MY_TABLE(id,blob_col)
VALUES(1,'" . file_get_contents('/full/path/to/file/myfile.png') . "')"
Based on this answer: http://stackoverflow.com/a/7052685/4103154
If you run into any problems let me know.
0
How can we insert it in database