Search found 2 matches

by johnd
Thu Aug 06, 2009 10:54 pm
Forum: PHP - Code
Topic: iterating $i++ within db query while loop
Replies: 3
Views: 195

Re: iterating $i++ within db query while loop

Thank you both, I fixed it with the following. Cheers!

Code: Select all

 
 
$i = 0; 
 
while($row = mysql_fetch_array($result))
{
if (mysql_num_rows($result) >= '1')
{
$i++;
 
 
by johnd
Thu Aug 06, 2009 7:31 pm
Forum: PHP - Code
Topic: iterating $i++ within db query while loop
Replies: 3
Views: 195

iterating $i++ within db query while loop

Hi All, I'm attempting to use a for statement to dynamically change <div> and <a> id and class names via based on the number of records returned from a query. I'm running into a problem and they are not iterating, both are remaining at 0. Thank you in advance! For statement: $limit = mysql_num_rows(...