RE: [PHP-DB] displaying result across 3 cells - where did I go wrong?
| From: | Aaron Wolski | Date: | Tue, 05 Aug 2003 13:19:55 +0000 |
| Subject: | RE: [PHP-DB] displaying result across 3 cells - where did I go wrong? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-29675@lists.php.net to get a copy of this message | ||
Hey John,
Thanks for spotting that.
So.. do I need to use 2 different incrementors? $z and say $x for each
part?
I basically pieced this code together from several examples I found so
forgive forgive the fact I don't know a whole lot about the code even
though I've tried to understand it as much as possible *shrugs*
Aaron
-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000@charter.net]
Sent: August 5, 2003 9:08 AM
To: Aaron Wolski; php-db@lists.php.net
Subject: Re: [PHP-DB] displaying result across 3 cells - where did I go
wrong?
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