Hello, Im not sure if i worded the header appropriatly but...
I have a script for viewing "rows" in my database. In the Database I have a column "Cat".
Now the script only allows me to view all in the 'sales' table. I want to be able to split these into categories from the "Cat" column.
I only have the values 1, 2 and 3 for the "Cat" column.
How do I categorize the output into 3 different html tables?
Thanks
Ben Williams
<table width="900" border="0">
<tr>
<td width="175"> </td>
<td width="610"><div align="left"></div></td>
<td width="101"> </td>
</tr>
<?php
$i=0;
while ($i < $num) {
$image1=mysql_result($result,$i,"Image1");
$image2=mysql_result($result,$i,"Image2");
$product=mysql_result($result,$i,"Product");
$description=mysql_result($result,$i,"Details");
$prodid=mysql_result($result,$i,"ProductID");
$price=mysql_result($result,$i,"Price");
$condition=mysql_result($result,$i,"State");
$cat=mysql_result($result,$i,"Cat");
?>
<tr>
<td><div align="center"><a href="product.php?id=<?php echo $prodid; ?>"><img src="<?php echo $image1 ; ?>" width="160" height="120" /></a></div></td>
<td><a href="product.php?id=<?php echo $prodid; ?>"><?php echo $product; ?></a></td>
<td>$<?php echo $price; ?></td>
</tr>
<?php
$i++;
}
?>