• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Need to Display a Category from Database

Need to have a ProductCatDesc displayed which is pulled from Database under Products Table
thank you
<p><?php echo $ProductCatDesc_row['ProductCatDesc']; ?></p>
current rs
<?php
$maxRows_WADAProducts = 9;
$pageNum_WADAProducts = 0;
if (isset($_GET['pageNum_WADAProducts'])) {
  $pageNum_WADAProducts = $_GET['pageNum_WADAProducts'];
}
$startRow_WADAProducts = $pageNum_WADAProducts * $maxRows_WADAProducts;

mysql_select_db($database_PowerStoreConnection, $PowerStoreConnection);
$query_WADAProducts = "SELECT ps4_products.*, coalesce(GroupingID,ps4_products.ProductID) AS GroupingID FROM ps4_products LEFT OUTER JOIN ps4_productoptions ON ps4_productoptions.ProductID = ps4_products.ProductID " .((isset($_SESSION["WADbSearch1_Products_Category_Results"]) && $_SESSION["WADbSearch1_Products_Category_Results"] != "")?"LEFT OUTER JOIN ps4_productcategories ON ps4_products.ProductID = ps4_productcategories.ProductID":""). " WHERE ProductLive = 1 AND (ProductStartDate IS NULL OR ProductStartDate <= CURDATE()) AND (ProductEndDate IS NULL OR ProductEndDate >= CURDATE()) " . ((isset($_SESSION["WADbSearch1_Products_Category_Results"]) && $_SESSION["WADbSearch1_Products_Category_Results"] != "")?$_SESSION["WADbSearch1_Products_Category_Results"]:"") . " GROUP BY coalesce(GroupingID,ps4_products.ProductID) ORDER BY ProductName";
setQueryBuilderSource($query_WADAProducts,$WADbSearch1,false);
$query_limit_WADAProducts = sprintf("%s LIMIT %d, %d", $query_WADAProducts, $startRow_WADAProducts, $maxRows_WADAProducts);
$WADAProducts = mysql_query($query_limit_WADAProducts, $PowerStoreConnection) or die(mysql_error());
$row_WADAProducts = mysql_fetch_assoc($WADAProducts);

if (isset($_GET['totalRows_WADAProducts'])) {
  $totalRows_WADAProducts = $_GET['totalRows_WADAProducts'];
} else {
  $all_WADAProducts = mysql_query($query_WADAProducts);
  $totalRows_WADAProducts = mysql_num_rows($all_WADAProducts);
}
$totalPages_WADAProducts = ceil($totalRows_WADAProducts/$maxRows_WADAProducts)-1;
?>

Open in new window

0
glozinski
Asked:
glozinski
  • 3
1 Solution
 
sameer2010Commented:
Hi,

Could you please provide more info on Products table? Is it same as ps4_products? If so, you are already getting those results.
0
 
glozinskiAuthor Commented:
yes,  it is the same table as ps4_products
what you should be reading is "Choose Your Leaves and we will custom build your Trees to Your needs."
If ProductCategoryID=6 therefore ProductCatDesc would be Choose Your Leaves and we will custom build your Trees to Your needs.
thank you
0
 
glozinskiAuthor Commented:
i got it working thank you
0
 
glozinskiAuthor Commented:
I got it wokring myself
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now