here is my revisted code:
<?php
include("connect_db.inc");
$cxn = mysqli_connect($host,$user,$password,$dbname)
or die ("couldn't connect to server");
/* Select shoes the type specified*/
$query = "SELECT * FROM products
WHERE prod_type=\"{$_POST['interest']}\"";
$result = mysqli_query($cxn,$query)
or die ("Couldn't execute query.");
/* Display results in a table */
echo "<table cellspacing='10' border='1' cellpadding='87'
width='100%'>";
echo "<tr><td colspan='5' style='text-align: right'>
Click on any picture to see a larger
version. <hr /></td></tr>\n";
while($row = mysqli_fetch_assoc($result))
{
$f_price = number_format($row['product_price'],2);
/* check whether shoes comes in colors */
$query = "SELECT * FROM Colour
WHERE product_name='{$row['product_name']}'";
$result2 = mysqli_query($cxn,$query)
or die(mysqli_error($cxn));
$ncolors = mysqli_num_rows($result2);
/* display row for each shoe */
echo "<tr>\n";
echo " <td>{$row['product_id']}</td>\n";
echo " <td style='font-weight: bold;
font-size: 1.1em'>{$row['product_name']}</td>\n";
echo " <td>{$row['product_description']}</td>\n";
/* display picture if shoe does not come in colours */
if( $ncolors <= 1 )
{
echo "<td><a href='/images/{$row['product_image']}'
border='0'>
<img src='/images/{$row['product_image']}'
border='0' width='100' height='80' />
</a></td>\n";
}
echo "<td align='center'>\$$product_price</td>\n
</tr>\n";
/* display row for each colour */
if($ncolors > 1 )
{
while($row2 = mysqli_fetch_assoc($result2))
{
echo "<tr><td colspan=2> </td>
<td>{$row2['product_colour']}</td>
<td><a href='/images/{$row2['product_image']}'
border='0'>
<img src='/images/{$row2['product_image']}'
border='0' width='100'
height='80' /></a></td>\n";
}
}
echo "<tr><td colspan='5'><hr /></td></tr>\n";
}
echo "</table>\n";
echo "<div style='text-align: center'>
<a href='shoes_list.php'>
<h3>Display more shoes</h3></a></div>";
?>
im not sure if the <a href..... link to my image is correct im not sure how to format it. my image directory is: C:\inetpub\wwwroot\shop\images