Hi friends,
I've a problem which i think should be very easy which i/m not able to solve. I wud appreciate if u guys can help me out.
I've written a code that displays some pics and some details abt it from the datebase. My problem is that it displays all the records one below the other, but i want it to display in two columns with 2 records in a row and then below that another 2 and so on.
This is my code:
<table>
<?php $result = mysql_query("SELECT * FROM properties ORDER BY title");
while ($row = mysql_fetch_array($result))
{
$propertyID = $row['propertyID'];
$title = $row['title'];
$price = $row['price'];
$link = $row['link'];
$main_page = $row['main_page'];
$photo = $row['photo'];
$comments = $row['comments'];
?>
<tr>
<td width="14"><img border=0 src="images/spacer.gif" width="14"></td>
<td width="112" valign="top">
<?php echo "<a href=\"property_details.php?propertyID=$propertyID\">";?><?php echo '<img border=0 src="properties/' . $photo . '" ALT="" height=78 width=125 class="photo" /></a>'; ?>
<img border=0 src="images/spacer.gif" width="1" height="8"></td>
<td width="8"><img border=0 src="images/spacer.gif" width="8"></td>
<td valign="top" class="featured" align="left"><img border=0 src="images/spacer.gif" width="111" height="1"><br>
<?php echo "<span class=\"header2\"><a href=\"$link\">$title </a></span>";
echo "<p><span class=\"price\">$price</span></p>";
?>
</td>
<td width="14"><img border=0 src="images/spacer.gif" width="14"></td></tr>
<tr></tr>
<?php
}
?>
</table>
Can anyone please help me out with this.
Thanks