Re: displaying result across 3 cells - where did I go wrong?
| From: | CPT John W. Holmes | Date: | Tue, 05 Aug 2003 13:08:10 +0000 |
| Subject: | Re: displaying result across 3 cells - where did I go wrong? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-29674@lists.php.net to get a copy of this message | ||
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...