Getting Query Results Row Number during a While Loop
| From: | The Snake from Hell! | Date: | Wed, 22 Dec 2004 19:18:09 +0000 |
| Subject: | Getting Query Results Row Number during a While Loop | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-204981@lists.php.net to get a copy of this message | ||
If you know the row count then use a for loop.
$count = mysql_num_rows($result);
for ($i=0;$i<$count;$i++) {
echo "I = $i";
}
Brad Dameron
Systems Administrator
SeaTab Software
www.seatab.com
>I am creating a query and displaying the results during a
while Loop. I know how to get >the total number of rows
but need to know which row I am currently working on in the
loop.
>
>Thanks in advance for your help
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php