Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #36389 : error on binding result parameter for prepared statement
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 9th August 08:02
php-bugs@lists.php.net (camka at email dot
External User
 
Posts: 1
Default #36389 : error on binding result parameter for prepared statement



From: camka at email dot ee
Operating system: win xp
PHP version: 5.1.2
PHP Bug Type: MySQLi related
Bug description: error on binding result parameter for prepared statement

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

--
Edit bug report at http://bugs.php.net/?id=36389&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36389&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36389&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36389&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36389&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36389&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36389&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36389&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36389&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36389&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36389&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36389&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36389&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36389&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36389&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36389&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36389&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36389&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36389&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36389&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36389&r=mysqlcfg
  Reply With Quote


  sponsored links


2 9th August 08:03
tony2001
External User
 
Posts: 1
Default #36389 : error on binding result parameter for prepared statement



ID: 36389
Updated by: tony2001@php.net
Reported By: camka at email dot ee
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: win xp
PHP Version: 5.1.2
New Comment:

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip


Previous Comments:
------------------------------------------------------------------------

[2006-02-14 12:52:04] camka at email dot ee

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


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36389&edit=1
  Reply With Quote
3 9th August 08:52
php-bugs@lists.php.net (camka at email dot
External User
 
Posts: 1
Default #36389 : error on binding result parameter for prepared statement


ID: 36389
User updated by: camka at email dot ee
Reported By: camka at email dot ee
-Status: Feedback
+Status: Open
Bug Type: MySQLi related
Operating System: win xp
PHP Version: 5.1.2
New Comment:

problem remains


Previous Comments:
------------------------------------------------------------------------

[2006-02-14 18:24:33] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip

------------------------------------------------------------------------

[2006-02-14 12:52:04] camka at email dot ee

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


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36389&edit=1
  Reply With Quote
4 9th August 08:52
tony2001
External User
 
Posts: 1
Default #36389 : error on binding result parameter for prepared statement


ID: 36389
Updated by: tony2001@php.net
Reported By: camka at email dot ee
-Status: Open
+Status: Assigned
Bug Type: MySQLi related
Operating System: win xp
PHP Version: 5.1.2
-Assigned To:
+Assigned To: georg
New Comment:

Georg, please take a look at it.
Looks like another client<->server version incompatibility and/or
windows weirdness.
Not reproducible on Linux with MySQL 5.0.16.


Previous Comments:
------------------------------------------------------------------------

[2006-02-14 23:15:25] camka at email dot ee

problem remains

------------------------------------------------------------------------

[2006-02-14 18:24:33] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip

------------------------------------------------------------------------

[2006-02-14 12:52:04] camka at email dot ee

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


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36389&edit=1
  Reply With Quote
5 9th August 10:15
georg
External User
 
Posts: 1
Default #36389 : error on binding result parameter for prepared statement


ID: 36389
Updated by: georg@php.net
Reported By: camka at email dot ee
-Status: Assigned
+Status: Feedback
Bug Type: MySQLi related
Operating System: win xp
PHP Version: 5.1.2
Assigned To: georg
New Comment:

Please try latest version from
http://dev.mysql.com/downloads/connector/php/


Previous Comments:
------------------------------------------------------------------------

[2006-02-14 23:22:21] tony2001@php.net

Georg, please take a look at it.
Looks like another client<->server version incompatibility and/or
windows weirdness.
Not reproducible on Linux with MySQL 5.0.16.

------------------------------------------------------------------------

[2006-02-14 23:15:25] camka at email dot ee

problem remains

------------------------------------------------------------------------

[2006-02-14 18:24:33] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip

------------------------------------------------------------------------

[2006-02-14 12:52:04] camka at email dot ee

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


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36389&edit=1
  Reply With Quote
6 9th August 10:15
php-bugs@lists.php.net (camka at email dot
External User
 
Posts: 1
Default #36389 : error on binding result parameter for prepared statement


ID: 36389
User updated by: camka at email dot ee
Reported By: camka at email dot ee
-Status: Feedback
+Status: Open
Bug Type: MySQLi related
Operating System: win xp
PHP Version: 5.1.2
Assigned To: georg
New Comment:

The latest PHP extension + mysql client API lib from mysql.com solved
the problem.

Thanks a lot.


Previous Comments:
------------------------------------------------------------------------

[2006-02-15 08:37:53] georg@php.net

Please try latest version from
http://dev.mysql.com/downloads/connector/php/

------------------------------------------------------------------------

[2006-02-14 23:22:21] tony2001@php.net

Georg, please take a look at it.
Looks like another client<->server version incompatibility and/or
windows weirdness.
Not reproducible on Linux with MySQL 5.0.16.

------------------------------------------------------------------------

[2006-02-14 23:15:25] camka at email dot ee

problem remains

------------------------------------------------------------------------

[2006-02-14 18:24:33] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip

------------------------------------------------------------------------

[2006-02-14 12:52:04] camka at email dot ee

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


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36389&edit=1
  Reply With Quote
7 9th August 10:15
tony2001
External User
 
Posts: 1
Default #36389 : error on binding result parameter for prepared statement


ID: 36389
Updated by: tony2001@php.net
Reported By: camka at email dot ee
-Status: Open
+Status: Bogus
Bug Type: MySQLi related
Operating System: win xp
PHP Version: 5.1.2
Assigned To: georg
New Comment:

Not PHP problem.


Previous Comments:
------------------------------------------------------------------------

[2006-02-15 09:39:25] camka at email dot ee

The latest PHP extension + mysql client API lib from mysql.com solved
the problem.

Thanks a lot.

------------------------------------------------------------------------

[2006-02-15 08:37:53] georg@php.net

Please try latest version from
http://dev.mysql.com/downloads/connector/php/

------------------------------------------------------------------------

[2006-02-14 23:22:21] tony2001@php.net

Georg, please take a look at it.
Looks like another client<->server version incompatibility and/or
windows weirdness.
Not reproducible on Linux with MySQL 5.0.16.

------------------------------------------------------------------------

[2006-02-14 23:15:25] camka at email dot ee

problem remains

------------------------------------------------------------------------

[2006-02-14 18:24:33] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36389

--
Edit this bug report at http://bugs.php.net/?id=36389&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666