I need a little help please... basically what I want to to is display certain information on product listing page based on the categories parent_id.
If I try to display the parent_id from the query bellow I keep getting 0
Code:
<?
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
$product_info1 = tep_db_fetch_array($categories_query);
echo $product_info1['parent_id'];
?>
If from the same query I try
Code:
echo $product_info1['categories_name];
, I get the correct category name where the product is located, as well as if I try
Code:
echo $product_info1['categories_id];
I get the correct number of the category where the product is located in.
I just cant get the parent_id. Can anybody please help me find what I'm doing wrong or with the correct query.