I want to display 3 columns per row, this is what I have, it kind of works, the second column on the first row does not have a border so i guess it's not working perfectly.
what is wrong?
<?php
require('settings.php');
$connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$DB", "", "") or die ("Sorry I could not open the database.");
?>
<table width="95%" border="1" cellspacing="0" cellpadding="0">
<?php
$y = 1;
$query = "SELECT * FROM Items";
$result = odbc_exec($connection, $query) or die ("Error: ". odbc_error());
while(odbc_fetch_row($result)){
$ID = odbc_result($result, 1);
$AName = str_replace("^", "'", odbc_result($result, 2));
$ADesc = str_replace("^", "'", odbc_result($result, 3));
$Bid = 0;
$query2 = "SELECT TOP 1 * FROM Bids WHERE ID = $ID order by BidValue desc";
$result2 = odbc_exec($connection, $query2) or die ("Error: ". odbc_error());
while(odbc_fetch_row($result2)){
$Bid = odbc_result($result2, 5);
}
?>
<?php
if ($y == 1){
echo "<tr>";
}
?>
<td>
<table width="33%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img title="" alt="" src="staff/dh.jpg" height="160" />
</td>
</tr>
<tr>
<td><font class="GSB"><?php echo $AName; ?></font><br /><hr /></td>
</tr>
<tr>
<td><font class="GSB">Current Bid: $<?php echo $Bid; ?> </font></td>
</tr>
<tr>
<td><font class="GSN"><?php echo $ADesc; ?></font></td>
</tr>
<tr>
<td><a href="view.php?ID=<?php echo $ID; ?>"><font class="GSI">View</font></a></td>
</tr>
</table>
</td>
<?php
$y++;
if ($y == 4){
echo "</tr>";
$y = 1;
}
} ?>
</tr>
</table>