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
 [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: Wed Jul 24 09:01:30 2024 UTC