PDO::PARAM_LOB and MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all.

I'm trying to read binary data from a MySQL 5 database using PDO's PARAM_LOB stream, but it's not working. It always returns the data as a string (not a stream).

I've found discussions where other people had this problem, but they all seem to have been solved by settng the PDO::ATTR_EMULATE_PREPARES attribute, which didn't work for me.

Here's the script I'm using
http://scratch.leftbrained.org/param_lob.phps

the get_db() function instantiates a named instance of the PDO object, and returns it (or just returns it if it's already been created, which, in this script, never happens). That instance, when created, is passed the

PDO::MYSQL_ATTR_USE_BUFFERED_QUERY flag.
I've tried disabling that to see if it affected my problem, and it didn't.

I based this code off the example in the documentation:

http://us2.php.net/manual/en/ref.pdo.php#AEN149844  (Example 12. Displaying an image from a database)

Any suggestions? It seems to be that it *should* be doing what I want, but it isn't.

Thanks,

Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux