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> </td>";
}
if ($i!=4)echo '<TD> </TD>';
if ($i==4){
echo "</TR>";
if (!$end)$i=0;
}
}
Dobromir Velev
-----Original Message-----
From: Matt Nigh <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]