Req #38150 [Opn->Asn]: Please add row tell and seek for mysqli
| From: | uw@php.net | Date: | Thu, 06 Jan 2011 14:03:44 +0000 |
| Subject: | Req #38150 [Opn->Asn]: Please add row tell and seek for mysqli | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157674@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=38150&edit=1
ID: 38150
Updated by: uw@php.net
Reported by: php at adaniels dot nl
Summary: Please add row tell and seek for mysqli
-Status: Open
+Status: Assigned
Type: Feature/Change Request
Package: MySQLi related
Operating System: Any
PHP Version: 5.1.4
-Assigned To:
+Assigned To: mysql
Block user comment: N
Private report: N
New Comment:
That's for buffered results only. I don't see a big win considering the
iterator support added rather recently (but not properly documented).
Johannes, what's your take?
Previous Comments:
------------------------------------------------------------------------
[2006-07-19 19:13:24] php at adaniels dot nl
I mean:
function get_all_rows(mysqli_result $result)
{
$ptr = $result->row_tell();
$rows = array();
$result->data_seek(0);
while ($row = $result->fetch_row()) $rows[] = $row;
$result->row_seek($ptr);
return $rows;
}
------------------------------------------------------------------------
[2006-07-19 19:06:42] php at adaniels dot nl
Description:
------------
The mysql API functions mysql_row_tell and mysql_row_seek are not ported
to the mysqli libary.
I believe this is a shame, because currently it isn't possible to create
a function which uses a mysql_result but does not influence the code
outside of the function.
I do not see the fact that, mysqli_row_seek would return a resource and
not an actual rownumber, as a problem.
P.S. If it is generaly agreed that this is a usefull feature, but there
are no volenteers to add the function, I volenteer myself.
Reproduce code:
---------------
I would like to do the following:
function get_all_rows(mysqli_result $result)
{
$ptr = $result->row_tell();
$rows = array();
while ($row = $result->fetch_row()) $rows[] = $row;
$result->row_seek($ptr);
return $rows;
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=38150&edit=1