Re: displaying result across 3 cells - where did I go wrong?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Aaron Wolski" <aaronjw@martekbiz.com>
>
>                                                 while($z++ %3 !==0)
[snip]
>                 echo (++$z %3 == 0) ? '</tr>' : '';

The first time through your code, $z is zero. Since the "thread titles"
don't match, your going to get to your while loop above. $z is zero, so your
while loop isn't executed, but $z is incremented to one. Then, later in your
code you increment $z to two and check for the modulus 3. So basically,
every time you switch "thread titles", $z is incremented one more than it
should be and you miss out on one cell in the following row.

---John Holmes...


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux