Hi,

I have this category / subcategory table, based on this what will be my query to get products from a specific top level category and all its subcategories ?

Code:
CREATE TABLE IF NOT EXISTS `categories` (
  `catg_id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `catg_pid` mediumint(9) NOT NULL DEFAULT '0',
  `catg_name` varchar(30) NOT NULL,
  `catg_description` varchar(255) NOT NULL,
  `catg_status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`catg_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
Thanks.