Re: php/mysql horizontal listing query

From: Date: Wed, 27 Jun 2001 07:21:18 +0000
Subject: Re: php/mysql horizontal listing query
Groups: php.db 
Request: Send a blank email to php-db+get-9855@lists.php.net to get a copy of this message
Hi, may be this will be helpfull $res=mysql_query("select release from tbl_release"); for ($i=1;$i<=4;$i++){ if ($i==1)echo "<tr>"; $row=mysql_fetch_row($res); if ($row) echo "<TD>$row[0]</TD>"; else { $end=1; echo "<td>&nbsp;</td>"; } if ($i!=4)echo '<TD>&nbsp;</TD>'; if ($i==4){ echo "</TR>"; if (!$end)$i=0; } } Dobromir Velev -----Original Message----- From: Matt Nigh <matt@mattnigh.com> To: php-db@lists.php.net <php-db@lists.php.net> Date: Wednesday, June 27, 2001 4:33 AM Subject: [PHP-DB] php/mysql horizontal listing query hello knowledgeable people of the php-db list, i have a question for you regarding PHP using MySQL. my problem is this: I need a section of a record label site with a releases section listed horizontally but here's the twist: after every 4 releases, I want the releases to move to the next columns below. ex. release#1, release#2, release#3, release#4 release#5, release#6 each release is stored in a database called almavale_releases and there are 6 rows: id, bandname, albumtitle, coverpic, albumcode, datereleased so what i need to know is what php code do I need to accomplish this? your help is greatly appreciated and give my thanks in advance. email me offlist with your solutions/suggestions or send it to the list. it's great to see the php/db experts sharing their knowledge with the not-so-experts like myself on this list, I learn new stuff all the time on this great list! Matt

« previous php.db (#9855) next »