Hi All
I posted in a while ago abot displaying the results of a query in 4
columns. The piece of code I was given works fine:
<table width="100%" border="0" cellspacing="0" cellpadding="10 ">
<?php
do {
$tr = !(++$row % 2);
if (!$tr) print "<tr>";
?>
<td width="100">
<div align="center">
<a href="productde tail.php?id=<?p hp echo $row_Recordset1['id']; ?>">
<img src="/user_thumbs/<?php echo $row_Recordset1['file']; ?>"
border="0"></a>
</div>
</td>
<td><?php echo $row_Recordset1['title']; ?>
</td>
<?php if ($tr) print "</tr>";
} while ($row_Recordset 1 = mysql_fetch_ass oc($Recordset1) );
if (!$tr) print "</tr>";
?>
</table>
I'm doing something else at the moment and I want more columns so I
thought easy, just change:
$tr = !(++$row % 2);
to
$tr = !(++$row % 4);
But it would appear that I missed the plot somewhere.
Can someone throw any light on this please.
Cheers
Andy
I posted in a while ago abot displaying the results of a query in 4
columns. The piece of code I was given works fine:
<table width="100%" border="0" cellspacing="0" cellpadding="10 ">
<?php
do {
$tr = !(++$row % 2);
if (!$tr) print "<tr>";
?>
<td width="100">
<div align="center">
<a href="productde tail.php?id=<?p hp echo $row_Recordset1['id']; ?>">
<img src="/user_thumbs/<?php echo $row_Recordset1['file']; ?>"
border="0"></a>
</div>
</td>
<td><?php echo $row_Recordset1['title']; ?>
</td>
<?php if ($tr) print "</tr>";
} while ($row_Recordset 1 = mysql_fetch_ass oc($Recordset1) );
if (!$tr) print "</tr>";
?>
</table>
I'm doing something else at the moment and I want more columns so I
thought easy, just change:
$tr = !(++$row % 2);
to
$tr = !(++$row % 4);
But it would appear that I missed the plot somewhere.
Can someone throw any light on this please.
Cheers
Andy
Comment