|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-08-25 08:37 UTC] mark-phpbug at vectrex dot org dot uk
  [2006-08-25 08:47 UTC] tony2001@php.net
  [2006-08-25 10:02 UTC] mark-phpbugs at vectrex dot org dot uk
  [2006-08-25 10:18 UTC] tony2001@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Wed Oct 29 09:00:01 2025 UTC | 
Description: ------------ When selecting from a FLOAT column, PDO returns garbage instead of the right value. Tested in PHP 5.1.2 and 5.1.6; both fail in similar ways. Reproduce code: --------------- <?php error_reporting(E_ALL); $db = new PDO("mysql:host=localhost;dbname=test", 'root', '', array()); $db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); $db->exec("CREATE TEMPORARY TABLE test ( num FLOAT NOT NULL)"); $db->exec("INSERT INTO test VALUES (1.5)"); $st = $db->query("SELECT * FROM test"); $row = $st->fetch(PDO::FETCH_ASSOC); var_dump($row); ?> Expected result: ---------------- array(1) { ["num"]=> string(12) "1.5" } Actual result: -------------- array(1) { ["num"]=> string(12) "-2.87989e-05" } Also other incorrect values; it seems nondeterministic.