Hi guys
I am trying to display my images in 3 colums.
At presant I have this
http://www.richard-howells.co.uk/final_project/products.php
THe code for this is here:
<?php
include('includes/misc.inc');
$per_row = 5;
$query = mysql_query('SELECT product_type_description AS catname, product_type_image AS catimg FROM product_types ORDER BY product_type_description');
if(!$query)/*if $result not available */
{die("Couldn't execute query. Reason: ".mysql_error());}
$i = 0;
while ($row = mysql_fetch_array($query)) {
if ($i % $per_row == 0 && $i != 0) {
$i = 0;
echo '</tr><tr>';
}
echo '<td class="logindescriptions"><a href="..."><img src="images/thumbnail_images/' . $row['catimg'] . '" border="0"></a><br />' . $row['catname'] . '</td>';
$i++;
}
if ($i != 0 && $i != $per_row) {
echo '<td colspan="' , ($per_row - $i) , '"> </td>';
}
?>
I know that only a small poiece of coding is needed, i just dont know how to implement it.
Please help if possible.
Regards
Thnaks
Richard