#38976 [Opn->Fbk]: missing last character when fetching query
ID: 38976
Updated by: tony2001@php.net
Reported By: zolfi at parspooyesh dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: fedora linux 5
PHP Version: 5.1.6
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2006-09-27 16:52:29] 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
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38976&edit=1
Thread (7 messages)