Re: newbie algorithm help!!!!!
| From: | Richard Lynch | Date: | Mon, 25 Jun 2001 06:23:59 +0000 |
| Subject: | Re: newbie algorithm help!!!!! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55100@lists.php.net to get a copy of this message | ||
> > i have a mysql table with approx. 30 entries.
> >
> > I wanna get them(i know how to do that) and list them in a 2-column
table.
For those minimalist-typists among us... :-)
$rowcount = 0;
echo "<TABLE><TR>\n";
while (list($whatever) = mysql_fetch_row($result)){
echo "<TD>$whatever</TD>\n";
$rowcount++;
if ($rowcount % 2 == 0){
echo "</TR><TR>\n";
}
}
Change the 2 to other number for more columns.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm