ID: 41831 Updated by: [EMAIL PROTECTED] Reported By: bennovandenberg at gmail dot com -Status: Open +Status: Feedback Bug Type: PDO related Operating System: FreeBSD 6.2 PHP Version: 5.2.3 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2007-06-27 21:18:59] bennovandenberg at gmail dot com Description: ------------ pdo_sqlite replaces a resource variable with the content of the file as text. This happens after the execute command. I tried the same with mysql, but with pdo_mysql it still stays a resource. So I guess the problem is with pdo_sqlite. (or its normal behavior to change the resource to text, but then pdo_mysql is wrong) Reproduce code: --------------- $pdo = new PDO("sqlite:/somepath/mydb.sq3"); $filename = "test"; $imagehandle = fopen($imagelocation, 'r'); // is_resource($imagehandle) == true $stmt = $pdo->prepare("INSERT INTO Images (filename, image_data) VALUES (?,?);"); $stmt->bindParam(1, $filename); $stmt->bindParam(2, $imagehandle, PDO::PARAM_LOB); $stmt->execute(); // is_resource($imagehandle) == false Expected result: ---------------- After the execute() I espect the $imagehandle to still be a resource. Actual result: -------------- $imagehandle has become a string with the content of the image. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41831&edit=1