> I think I figured this out -
> Since I only have 2 pages, the first iteration of the loop sets $i greater
> than than the number of pages, i.e. $i becomes 21, which is
> greater than 2,
> so the second iteration stops there. Am I seeing this right?
> So Craig's way worked because $i was left alone in the for()
> expressions and
> only modified in the statement, therefore on the second
> iteration, $i was 2
> and thus it satisfied the second expression and iterated once more.
> I *think* I'm understanding this correctly, though if others see it
> differently, please let me know!

Yup....that's what I figured you were doing which was why I saw a problem
with the for loops having $i being incremented by more than one (ex. $i +
20).  In order for that to have worked more effectively you would have
needed to multiple $num_pages by 20 as well before the for loop was called
which was redundant....and probably would have caused problems with getting
the proper results from the database depending on how you coded it.


Craig Vincent

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to