Ok,
I will explain and give some code. I am sure there is a better way to accomplish what I am trying to do. I am fairly new at this.
I have an overall query for the main content.
$sql = "SELECT PageID,
GeneralWhatsNew,
WhatsNewHeader,
GentextA,
GentextB,
GentextC,
GenRightA,
GenRightB,
GenLeftA,
GenLeftB,
PageMessage
FROM $table_A
WHERE PageID = '$PageID'
";
$result = @($sql,$connection);
while ($row = mysql_fetch_array($result)) {
$PageName = $row['PageName'];
$GeneralWhatsNew = $row['GeneralWhatsNew'];
$WhatsNewHeader = $row['WhatsNewHeader'];
$GentextA = $row['GentextA'];
$GentextB = $row['GentextB'];
$GentextC = $row['GentextC'];
$GenRightA = $row['GenRightA'];
$GenRightB = $row['GenRightB'];
$GenLeftA = $row['GenLeftA'];
$GenLeftB = $row['GenLeftB'];
$PageMessage = $row['PageMessage'];
}
{
$today = date("l, F jS Y");
}
Then for the specific places that I want to have a list of categories, I then includes another query for that specific place.
$sql = "SELECT ProductID,
ProductName,
ProductSku,
ProductCategory,
ProductSubCategory,
ProductImageFullsize,
ProductImageThumbnail,
ProductImagePopup,
ProductDescription,
ProductPrice,
ProductWeight,
ProductSize
FROM $table_C
GROUP BY ProductCategory
";
$result = @($sql,$connection);
while ($row = mysql_fetch_array($result)) {
$ProductID = $row['ProductID'];
$ProductName = $row['ProductName'];
$ProductSku = $row['ProductSku'];
$ProductCategory = $row['ProductCategory'];
$ProductSubCategory = $row['ProductSubCategory'];
$ProductImageFullsize = $row['ProductImageFullsize'];
$ProductImageThumbnail = $row['ProductImageThumbnail'];
$ProductImagePopup = $row['ProductImagePopup'];
$ProductDescription = $row['ProductDescription'];
$ProductPrice = $row['ProductPrice'];
$ProductWeight = $row['ProductWeight'];
$ProductSize = $row['ProductSize'];
$category_list .= " -» <a href=\"products.php?PageID=$ProductCategory&ProductCategory=$ProductCategory\" class=\"categorylist\">$ProductCategory</a><br>
";
}
?>
I then would have something for the featured product or sub category:
$sql = "SELECT ProductID,
ProductName,
Featured,
ProductImageThumbnail
FROM $table_C
WHERE Featured = 'yes'
LIMIT 4
";
$result = @($sql,$connection);
while ($row = mysql_fetch_array($result)) {
$ProductID = $row['ProductID'];
$ProductName = $row['ProductName'];
$ProductImageThumbnail = $row['ProductImageThumbnail'];
$feature_product .= "<a href=\"product-detail.php?ProductID=$ProductID\" class=\"categorylist\"><img src=\"graphics/$ProductImageThumbnail\" border=0>
<br>$ProductName</a>
<hr size=1 width=\"90%\" color=\"#cccccc\">
";
}
?>
thanks for your help. Hope this explains it a bit further