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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Jul 16 06:01:29 2024 UTC