|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-20 06:15 UTC] thekid@php.net
[2005-02-20 18:56 UTC] hholzgra@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
Description: ------------ PDO/MySQL getColumnMeta() always returns bool(false) in pdo_mysql due to a bogus check Reproduce code: --------------- the following sourcecode: <?php $dbh= new PDO('mysql:host='.$argv[1], $argv[2], $argv[3]); $stmt= $dbh->prepare('select * from entries where id = :id'); $stmt->bindParam(':id', $argv[4]); if (!$stmt->execute()) { var_dump($dbh->errorInfo()); exit; } for ($i= 0, $s= $stmt->columnCount(); $i < $s; $i++) { echo $i, ':: '; var_dump($stmt->getColumnMeta($i)); } ?> Expected result: ---------------- 0:: array(6) { ["native_type"]=> string(4) "LONG" ["flags"]=> array(2) { [0]=> string(8) "not_null" [1]=> string(11) "primary_key" } ["name"]=> string(2) "id" ["len"]=> int(11) ["precision"]=> int(0) ["pdo_type"]=> int(2) } 1:: array(6) { ["native_type"]=> string(10) "VAR_STRING" ["flags"]=> array(0) { } ["name"]=> string(5) "title" ["len"]=> int(200) ["precision"]=> int(0) ["pdo_type"]=> int(2) } [...and so on...] Actual result: -------------- 1:: bool(false) 2:: bool(false) [...and so on...]