previous, current and next while looping
| From: | Wilbert Enserink | Date: | Wed, 19 Jun 2002 09:28:37 +0000 |
| Subject: | previous, current and next while looping | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-102899@lists.php.net to get a copy of this message | ||
Hi all,
I'm doing this query and looping through the results:
$result_ID_ID=mysql_query($gallery_list_query) OR die(mysql_error());
$counter=0;
while ($queryresult_IDresult=mysql_fetch_array($result_ID_ID))
{
$result_array['$counter']=$queryresult_IDresult;
if ($result_array['$counter']['galleryID']==$galleryID)
{
$current_number=$counter+1;
$current_item=current(($result_array));
$next_item=next($result_array);///////this doesn't seem te work.
}
$counter=$counter+1;
}
When it has found the right record with ID number $galleryID I also need the previous record and the
next record. Anybody has any clue how to do this?
thx Wilbert
-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
info@pdd.nl
-------------------------