I have an image file stored on a remote server. I only have HTTP access to the server, so I'm getting its content using file_get_contents(URL)
I need to store this content in a local sqlite3 database in a field of type 'blob'. I'm using the PDO object to connect to the database, and I'm using
$db->exec("INSERT INTO myTable (myImageBlob) VALUES
('".file_get_contents($filePath)."')")
to add data to the database.
This isn't working. Apologies if I'm making a really noobish mistake. We all have to learn somehow...
For reasons I will not delve into, it is not a possibility for me to store the image locally and put the URL in the database. It /has/ to be stored in a blob.