note 96850 modified in mysqli-stmt.bind-param by danbrown
| From: | danbrown@php.net | Date: | Fri, 19 Mar 2010 15:27:08 +0000 |
| Subject: | note 96850 modified in mysqli-stmt.bind-param by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167205@lists.php.net to get a copy of this message | ||
I did a prepared statement for inserting in a simple table - images ( blob ) and their unique
identifiers ( string ). All my blobs have smaller sizes than the MAX-ALLOWED-PACKET value.
I've found that when binding my BLOB parameter, I need to pass it as a STRING, otherwise
it's truncated to zero length in my table. So I have to do this:
<?php
$ok = $stmt->bind_param( 'ss', $id, $im ) ;
?>
--was--
I did a prepared statement for inserting in a simple table - images ( blob ) and their unique
identifiers ( string ). All my blobs have smaller sizes than the MAX-ALLOWED-PACKET value.
I've found that when binding my BLOB parameter, I need to pass it as a STRING, otherwise
it's truncated to zero length in my table. So I have to do this:
$ok = $stmt->bind_param( 'ss', $id, $im ) ;
http://php.net/manual/en/mysqli-stmt.bind-param.php