On 5 Oct 2010, at 2:06pm, Artur Reilin wrote:

> I searched quiet around the internet and cannot found an solution.
> 
> What I'm currently using is get the file contents and then use
> base64_encode to store them in database. But that just blows the size up.
> I saw that the firefox database (places.sqlite) store the favicons
> directly in database. I searched around and cannot found a doc how they do
> this.

Using base64 will allow you to take binary data (arbitrary 1s and 0s) and store 
it in a text field.  However, SQLite has BLOB fields, which can be used to 
store data in its original binary form, and will indeed take up fewer bytes 
than encoding it in base64.

So you need to look at the PHP functions for SQLite which mention BLOB fields, 
or do a relevant Google search.  They're a little more complicated to use than 
other fields because they can be so long, but they work fine.

If you want more details you need to tell us whether you're using the PDO 
interface to SQLite or the SQLite3 interface directly.  If you're not sure, 
just give us the URL of the page you're using for reference.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to