note 85629 deleted from mysqli-result.data-seek by cmb
| From: | cmb@php.net | Date: | Tue, 14 Sep 2021 13:25:07 +0000 |
| Subject: | note 85629 deleted from mysqli-result.data-seek by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216961@lists.php.net to get a copy of this message | ||
Note Submitter: kaisellgren at gmail dot com
----
This is useful function when you try to loop through the resultset numerous times.
For example:
<?php
$result = mysqli_query($connection_id,$query);
while ($row = mysqli_fetch_assoc($result))
{
// Looping through the resultset.
}
// Now if you need to loop through it again, you would first call the seek function:
mysqli_data_seek($result,0);
while ($row = mysqli_fetch_assoc($result))
{
// Looping through the resultset again.
}
?>