Hi.
 
I have this table in MySQL
 
CREATE TABLE `category` (
  `categoryId` int(4) NOT NULL auto_increment,
  `pcategoryId` int(4) NOT NULL default '0',
  `category` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`categoryId`)
) TYPE=MyISAM
 
to represent a hierarchical category
 
categoryId pcategoryId category
1 0 Water
2 1 Ozone
3 1 Ultra Pure
4 0 Cleaning
5 4 Kitchen
6 4 Bathroom
 
I need need to set a categoryId to a product in the table
 
CREATE TABLE `product` (
  `productId` int(4) NOT NULL auto_increment,
  `product` varchar(200) NOT NULL default '',
  `description` text,
  `categoryId` int(4) NOT NULL default '0',
  PRIMARY KEY  (`productId`)
) TYPE=MyISAM
 
I need to setup a combo with all the categories but ordered as :
 
Water
    Ozono
    Ultra Pure
Cleaning
    Kitchen
    Bathroom
 
Note: the category table not are in this order.
 
Any ideas ?
 
Sincerely
 
LFung
                              

Reply via email to