Re: More brain farts
| From: | David Robley | Date: | Wed, 07 Aug 2002 00:28:45 +0000 |
| Subject: | Re: More brain farts | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111455@lists.php.net to get a copy of this message | ||
In article <LOBBKHJGOJFPJMLKAHKFIEDCFPAB.b-bonini@cox.net>, b-
bonini@cox.net says...
> Another one of those thigns I've been staring at too long......
>
> I need to get this to have a new row every 4th cell
>
> <table>
> <tr>
> <?php
> while($row = mysql_fetch_object($result)) {
> $img = $row->image_name;
> if ( ($row->id % 4) == 0) {
> echo "<td><a href=\"/ss/images/$img\"><img
> src=\"/ss/thumbnails/" . $img .
> "\" />" . '</a></td>';
> } else {
> echo "<td><a href=\"/ss/images/$img\"><img
> src=\"/ss/thumbnails/" . $img .
> "\" />" . '</a></td>';
> }
> }
> ?>
> </tr>
> </table>
>
> Not sure how to make it work, obviously what I have so far is not it... ;-)
Would you not be better actually putting a </TR><TR> as the first item if
you have reached the fourth cell? And of course you would need to be sure
that $row->id is a series of consecutive numbers - perhaps you might be
better to use your own counter?
--
David Robley
Temporary Kiwi!
Quod subigo farinam