A table question
| From: | Ferzan | Date: | Tue, 18 Feb 2003 11:07:38 +0000 |
| Subject: | A table question | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-18573@lists.php.net to get a copy of this message | ||
Hi,
this is my first post. I'am a newbie in both newsgroups and php.I wrote the
following code to pick picture names from the database and then
insert them in a table.But unfortunately I could not manage to make rows
equal. I mean I want to have four <td></td> regardless of how many
pictures are there(there can be maximum 4 in a row). In other words I want
is just to have four <td></td> to make my table look normal.
<?
for( $i = 0; $row = mysql_fetch_array($viewpic); $i++ )
{
if( $i % 4 == 0 && $i != 0 && $i != mysql_num_rows( $viewpic ) - 1 ) echo
"</tr><tr>";
$tekharf = strtolower($row["BandName"]);
echo "<td><a href='http://mysite/Bands/viewfull.php?PicID={$row[PicID]}&BandID={$row[BandID]}'><img
class='link' src='http://mysite/pics/thumbnail/{$tekharf{0}}/{$row[PName]}.jpg'
border=1></a></td>";
}
?>