Quoth Artur Reilin <sql...@yuedream.de>, on 2010-10-05 15:06:57 +0200: > 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. > > Some days ago I found the following code: > > $image_handle = fopen($file,"rb"); > $image = addslashes(fread($image_handle,filesize($file)));
Why are you using addslashes? This sounds like you're trying to embed the whole thing as an SQL literal. Don't do that. Use a parameter in the SQL, then bind it with type SQLITE3_BLOB, ideally using a column with NONE affinity (e.g., of type BLOB NULL) underneath. (The addslashes function is often a red flag in the general case.) See http://us2.php.net/manual/en/sqlite3stmt.bindvalue.php if you haven't already. ---> Drake Wilson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users