ID: 38150
User updated by: php at adaniels dot nl
Reported By: php at adaniels dot nl
Status: Open
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 5.1.4
New Comment:
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;
}
Previous Comments:
------------------------------------------------------------------------
[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/?id=38150&edit=1