View Single Post
Old 08-19-2009, 12:10 PM   PM User | #3
funnymoney
Regular Coder

 
funnymoney's Avatar
 
Join Date: Aug 2007
Posts: 364
Thanks: 17
Thanked 24 Times in 24 Posts
funnymoney is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
But why do you need the second loop? You could use a counter variable, and increment it inside the first while loop to print the index.
like this

PHP Code:
$i=0;
while(
$row mysql_fetch_array$result )) {
       echo 
$i" - " $row['fieldname'] . "<br />";
      
$i++;
     } 
__________________
PHP Idea Factory
funnymoney is offline   Reply With Quote