php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64664 Reinitialize fetchAll
Submitted: 2013-04-18 06:50 UTC Modified: 2013-06-19 07:23 UTC
From: vtap at clubinternet dot fr Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.4.14 OS: Windows 7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vtap at clubinternet dot fr
New email:
PHP Version: OS:

 

 [2013-04-18 06:50 UTC] vtap at clubinternet dot fr
Description:
------------
$sql = "SELECT f1, f2 FROM test;";
$res = $pdo->query($sql);

$f1= $res->fetchAll(PDO::FETCH_COLUMN,0);
$f2= $res->fetchAll(PDO::FETCH_COLUMN,1);

$f1 is OK but $f2 is an empty array. Is there a way to reinitialize the cursor ?
I know I can rerun the query but wanted to know if it could be avoided.
Thanks.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-19 07:23 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2013-06-19 07:23 UTC] ab@php.net
This isn't a support forum, but there's no way to rewind without executing the 
statement again.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 19:01:30 2024 UTC