PDO::PARAM_LOB and MySQL

From: Date: Tue, 14 Nov 2006 15:57:33 +0000
Subject: PDO::PARAM_LOB and MySQL
Groups: php.general 
Request: Send a blank email to php-general+get-244597@lists.php.net to get a copy of this message
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

« previous php.general (#244597) next »