|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2011-04-17 20:36 UTC] johannes@php.net
  [2011-04-17 20:36 UTC] johannes@php.net
 
-Status: Open
+Status: Bogus
  [2011-04-17 20:36 UTC] johannes@php.net
  [2011-04-17 22:05 UTC] php_nospam at ramihyn dot sytes dot net
  [2011-04-17 22:20 UTC] php_nospam at ramihyn dot sytes dot net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 16:00:01 2025 UTC | 
Description: ------------ pdo_mysql_stmt_get_col() returns a string instead of an integer obtained from the database. This happens with the pdo_mysql extension included in the PHP download section as well as on my Ubuntu box. Looking at mysql_statement.c from the pdo_mysql source shows, that it returns a ZVAL reference instead of a string when compiled with mysqlnd, so if i may ask: why isnt it the default to compile with mysqlnd? Test script: --------------- <?php $mysql = new PDO('mysql:host=localhost;dbname=test', 'root', ''); $mysql->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); var_dump($mysql->query('SELECT 42')->fetch(PDO::FETCH_NUM)); ?> Expected result: ---------------- array(1) { [0]=> int(42) } Actual result: -------------- array(1) { [0]=> string(2) "42" }