|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-14 18:24 UTC] tony2001@php.net
[2006-02-14 23:15 UTC] camka at email dot ee
[2006-02-14 23:22 UTC] tony2001@php.net
[2006-02-15 08:37 UTC] georg@php.net
[2006-02-15 09:39 UTC] camka at email dot ee
[2006-02-15 10:12 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 17:00:02 2025 UTC |
Description: ------------ When trying to bind a result variable to a prepared statement the error "Using unsupported buffer type: 253" comes up. Moreover, the binded in paramter doesn't get binded correctly either as seen from mysql log. The other strange thing is that, if field datatype varchar(15) (< then 16) is used for tm table, than error 253 won't come up, buth the problem with binded parameter remains. Integer type works without the error as well. Tested with both current stable php version and the latest snapshot (Built On: Feb 14, 2006 11:30 GMT) Reproduce code: --------------- <?php echo "PHP version: ".phpversion(); $m = new mysqli('localhost','***','***','***'); $v = $m->query("select @@version as v")->fetch_assoc(); echo "\nMySQL version: ".$v['v']; $m->query("create temporary table tm (txt varchar(16))"); $m->query("insert into tm (txt) values ('2'),('3'),('4')"); $v = $m->query("select count(*) as v from tm")->fetch_assoc(); echo "\nNum of recs: ".$v['v']; $str = "select txt from tm where txt=?"; $ps = $m->prepare($str); $txt_in = '2'; $txt_out = null; if (!$ps->bind_param('s', $txt_in)) echo "\nbind_param: ".$ps->error; if (!$ps->bind_result($txt_out)) echo "\nbind_result: ".$ps->error; if ($ps->execute()) echo "\nexecuted successfully: ".$ps->num_rows; else echo "\nfailed ps execution: ".$ps->error; if (!$ps->store_result()) echo "\nstore_result: ".$ps->error; if ($z = $ps->fetch()) echo "\nfetched successfully: ".$txt_out; elseif($z === false) echo "\nfailed fetching: ".$ps->error; elseif($z === null) echo "\nno more records"; ?> Expected result: ---------------- PHP version: 5.1.2 MySQL version: 5.0.18-nt-log Num of recs: 3 executed successfully: 0 fetched successfully: 1 Actual result: -------------- PHP version: 5.1.2 MySQL version: 5.0.18-nt-log Num of recs: 3 bind_result: Using unsupported buffer type: 253 (parameter: 1) executed successfully: 0 no more records [mysql log file] 58 Query select @@version as v 58 Query create temporary table tm (txt varchar(16)) 58 Query insert into tm (txt) values ('2'),('3'),('4') 58 Query select count(*) as v from tm 58 Prepare [1] 58 Execute [1] select txt from tm where txt=0