I'm using the example on the following page for selecting and fetching
a large data object. <http://publib.boulder.ibm.com/infocenter/db2luw/
v9/index.jsp?topic =/com.ibm.db2.udb .apdv.php.doc/doc/t0023504.htm>
Here's what I've tried:
$avatarFile = tempnam('', '');
$avatarSteam = fopen($avatarFi le, 'wb');
$stmt = $dbh->prepare('SELEC T user_avatar FROM users WHERE user_id =
29');
$stmt->execute();
$stmt->bindColumn('us er_avatar', $avatarSteam, PDO::PARAM_LOB) ;
$stmt->fetch(PDO::FET CH_BOUND);
var_dump($cover Steam);
Ideally, $coverSteam should be a stream to a temporary file containing
the large data, but instead it's coming out as a string. And holding
the large data as a string in memory is exactly what I'm trying to
avoid. What am I doing wrong and how do I fix it? (I'm using SQLite,
in case it matters.)
a large data object. <http://publib.boulder.ibm.com/infocenter/db2luw/
v9/index.jsp?topic =/com.ibm.db2.udb .apdv.php.doc/doc/t0023504.htm>
Here's what I've tried:
$avatarFile = tempnam('', '');
$avatarSteam = fopen($avatarFi le, 'wb');
$stmt = $dbh->prepare('SELEC T user_avatar FROM users WHERE user_id =
29');
$stmt->execute();
$stmt->bindColumn('us er_avatar', $avatarSteam, PDO::PARAM_LOB) ;
$stmt->fetch(PDO::FET CH_BOUND);
var_dump($cover Steam);
Ideally, $coverSteam should be a stream to a temporary file containing
the large data, but instead it's coming out as a string. And holding
the large data as a string in memory is exactly what I'm trying to
avoid. What am I doing wrong and how do I fix it? (I'm using SQLite,
in case it matters.)
Comment