ID: 34022 User updated by: mike dot norton at ultisearch dot co dot uk Reported By: mike dot norton at ultisearch dot co dot uk -Status: Bogus +Status: Closed Bug Type: MySQLi related Operating System: Fedora Core 3 PHP Version: 5.0.4 New Comment:
Seems to work with that function correctly Previous Comments: ------------------------------------------------------------------------ [2005-08-07 01:39:00] [EMAIL PROTECTED] RTFM: http://www.php.net/manual/en/function.mysqli-stmt-send-long-data.php ------------------------------------------------------------------------ [2005-08-07 00:54:16] mike dot norton at ultisearch dot co dot uk Description: ------------ When using mysql with bind_params on blob data only the first 4 bytes of data get included. Reproduce code: --------------- <?php $mysqli = new mysqli("localhost", "user", "pass", "db"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $filename = "/path_to/files/5_copy14.jpg"; /* create a prepared statement */ $stmt = $mysqli->stmt_init(); $stmt->prepare("insert into user_image (image) values (?)"); $data = fread(fopen($filename, "rb"), filesize($filename)); $stmt->bind_param('b',$data); /* Prove that the $data variable contains the correct data */ print $data; $stmt->execute(); $stmt->close(); $mysqli->close(); ?> Expected result: ---------------- Image is displayed and image data is inserted into database Actual result: -------------- First 4K of image is inserted into database rest seems to be discarded ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34022&edit=1