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.

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.

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

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

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

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

-- 
Yves Goergen "LonelyPixel" <nospam.l...@unclassified.de>
Visit my web laboratory at http://beta.unclassified.de
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to