Re: [sqlite] Right way to store binary data into a blob

2012-10-03 Thread Tim Streater
On 03 Oct 2012 at 10:50, Clemens Ladisch wrote: > Tim Streater wrote: >> What's the right way to get the data into the column? > > 1) Use SQLite blob literals, which are hex strings with an "x" prefix: > > ... set imagedata = x'ffd8ffe000104a46...' where ... > > 2) Use

Re: [sqlite] Right way to store binary data into a blob

2012-10-03 Thread Simon Slavin
On 3 Oct 2012, at 9:33am, Tim Streater wrote: > I've got a temporary database with a blob column. I'm using the PHP PDO > interface, and I'd like to store some binary data into the blob; it's > actually an image. Later I'm going to read it back and write it to disk. >

Re: [sqlite] Right way to store binary data into a blob

2012-10-03 Thread Clemens Ladisch
Tim Streater wrote: > I've got a temporary database with a blob column. I'm using the PHP > PDO interface, and I'd like to store some binary data into the blob; > it's actually an image. > At the moment I'm using str_replace to change any single-quote to two > single-quotes, and then doing as

[sqlite] Right way to store binary data into a blob

2012-10-03 Thread Tim Streater
I've got a temporary database with a blob column. I'm using the PHP PDO interface, and I'd like to store some binary data into the blob; it's actually an image. Later I'm going to read it back and write it to disk. What's the right way to get the data into the column? At the moment I'm using