php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38976 missing last character when fetching query
Submitted: 2006-09-27 16:52 UTC Modified: 2006-10-05 01:00 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:2 (50.0%)
From: zolfi at parspooyesh dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.1.6 OS: fedora linux 5
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-09-27 16:52 UTC] zolfi at parspooyesh dot com
Description:
------------
when using SELECT statement for selecting rows of table, and 
using fetchAll(or fetch) method the last character of each row will be lost.


Reproduce code:
---------------
$db_location = "table.sqlite";

$db = new PDO("sqlite:{$db_location}");

$db->query("create table my_table (name text);");
// table is empty
$query = $db->query("delete from my_table");

$query = $db->query("insert into  my_table (name) values ('123')");

$query = $db->query("select name from my_table");

while ($row = $query->fetch())
{
     print_r($row);
}


Expected result:
----------------
Array
(
    [name] => 123
    [0] => 123
)


Actual result:
--------------
Array
(
    [name] => 12
    [0] => 12
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-27 16:57 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Can't reproduce.
 [2006-10-05 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-10-27 20:04 UTC] jason at southerntextile dot com
Since doing a fresh install of Fedora 6. This is occuring on all my SQLite databases (using PDO).
 [2006-10-27 21:23 UTC] jason at southerntextile dot com
Make that two differnt Fedora 6 servers with the same problem now (PHP 5.1.6 /w PDO).
 [2006-11-06 17:49 UTC] jason at southerntextile dot com
Latest Fedora RPMs (compilied Nov. 2) still affected by bug.
 [2006-11-26 17:53 UTC] kae at verens dot com
I have this error as well, and have been pulling my hair out for the last few days trying to figure out what was wrong with my code...

FC6, php-5.1.6-3.1.fc6, php-pdo-5.1.6-3.1.fc6
 [2006-11-26 18:07 UTC] kae at verens dot com
this bug appears to be fixed. I installed PHP 5.2 from the following repository, and the bug is gone:
http://remi.collet.free.fr/rpms/fc6.i386/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC