Hi All,
I have 2 tables, one has the items, the other is the manufacturer type.
Here is a link to what I did in HTML to achieve what I want. I am displaying 2 manufacturers on this page:
1) Stossel in the classroom
2) Jonathan Gullible).
Notice the rule between these 2 items, that is my challenge.
Here is what I am getting with my PHP generated page (notice the rule between each item not each manufacturer).
For example: my first product is ManufacturerID = 1 and there are 5 products for this Manufacturer. The next one is ManufacturerID = 2, and so on.
What I am trying to do is this:
ManufacturerID 1 = Fruit
ManufacturerID 2 = Vegetable
ManufacturerID 3 = Meat
etc...
And I trying to go from this:
Pears
Peaches
Apples
Carrots
Steak
to...
Pears
Peaches
Apples
-------------- <---- Horizontal rule to break up the Manufacturers
Carrots
-------------- <---- Horizontal rule to break up the Manufacturers
Steak
Here is the code to create the first example (without the rule)
$conn = mysql_connect("localhost", "x", "x")
OR DIE (mysql_error());
@mysql_select_db ("inthecla_products", $conn) OR DIE (mysql_error());
$sql = "SELECT * FROM Items, Manufacturer WHERE Items.SiteEnabled = 1 AND Items.ManufacturerID = Manufacturer.ManufacturerID ORDER BY Items.ManufacturerID";
$result = @mysql_query($sql, $conn) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
?>
<td><table width="100%" border="0">
<tr>
<td width="13%" rowspan="2"><div align="center"><a href="http://www.intheclassroom.com/cgi-bin/storefront.cgi?page=prod&prod=<?php echo($row['ProdID']); ?>" target="_blank"><img src="../images/<?php echo($row['Image']); ?>" alt="ITCM-In-The-Classroom-Media-John-Stossel-Greed-Video" width="100" height="100" border="0"></a></div></td>
<td class="font"><div align="center">
<table width="100%" border="0">
<tr>
<td width="44%"><div align="left"><span class="headerLarge"><?php echo $row['ManufacturerName'];?></span></div></td><td width="1%"></td>
<td width="55%"><div align="left"><a href="http://www.intheclassroom.com/cgi-bin/storefront.cgi?page=prod&prod=<?php echo($row['ProdID']); ?>" target="_blank"><img src="../images/<?php echo($row['Logo']); ?>" alt="ITCM-In-The-Classroom-Media-John-Stossel-Greed" width="91" height="42" border="0"></a></div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td width="87%" class="font"> <div align="left"><img src="http://www.intheclassroom.com/_default_designs/images/siteImages/clear_pixel.gif" height="8" width="1"><?php echo($row['ShortDescription']); ?></div></td>
</tr>
<tr><hr /></tr>
</table></td>
<?php
}
?>
The table for the Manufacturer is called "Manufacturer" and the field limiter (1,2,3) is called "ManufacturerID" for both ( I knew someone would ask me this, so I provided it up front)
I appreciate the help,
Don