|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-07-19 19:06 UTC] 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;
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 13:00:02 2025 UTC |
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; }