Hello Yves,

You could alway mime/uu/yenc encode it into text before insert, and do
the reverse when you retrieve it. Then the problem goes away.


C

Sunday, February 6, 2011, 10:53:05 AM, you wrote:

YG> On 06.02.2011 14:36 CE(S)T, Samuel Adam wrote:
>>       * You should be using bound parameters on INSERT.  If you are not, 
>> change  
>> your code.  This will eliminate a whole list of potential problems.

YG> I already do that.

>>       * Make sure the binding is done as BLOB and not TEXT.  PDO probably 
>> has  
>> its own flags defined for this.  This is the part that tells SQLite  
>> whether you are inserting TEXT or BLOB.

YG> There is a PDO method to execute a prepared statement with an array of
YG> values to be used as parameters. There is no way to specify additional
YG> information about how to interpret these values in this method. But
YG> there is another method to bind each value separately, and it has
YG> another argument to pass some data type. I'd need to change the way I
YG> execute my SQL statements to make use of it.

YG> I'd expect that SQLite known on its own what data type a column is and
YG> respect it. Seems like SQLite is sometimes more type-agnostic than PHP,
YG> where I take great care of data types in this special application.

YG> For now, I just won't save files to the database with SQLite but instead
YG> on disk. I won't get to rewriting the database class anytime soon but
YG> I'll look into it then.

YG> I'm wondering why I get all the data back but SQLite can't count its
YG> characters... And the image I get back from SQLite looks error-free so
YG> it probably didn't make a single mistake handling it as text data.




-- 
Best regards,
 Teg                            mailto:t...@djii.com

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

Reply via email to