[PHP] Getting Query Results Row Number during a While Loop

2004-12-22 Thread The Snake from Hell!
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 tot

RE: [PHP] Getting Query Results Row Number during a While Loop

2004-12-22 Thread Jay Blanchard
[snip] 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. [/snip] You need a variable, like $i, to hold the number, then increment and display $i = 0; while(your dat

[PHP] Getting Query Results Row Number during a While Loop

2004-12-22 Thread Michael Brennan-White
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.