Jump to content

Categories sql ?.


Davie33

Recommended Posts

Hi can anyone tell me the best way to set up an sql for categories.Am making a site for selling computers but wanted to know how i go about doing this for sql as i would like say, i had categories like this....

 

CREATE TABLE IF NOT EXISTS `cats` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `catname` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
  ) ENGINE=MyISAM  CHARACTER SET = utf8 COLLATE utf8_unicode_ci AUTO_INCREMENT=11 ;
  
   INSERT INTO `cats` (`id`, `catname`) VALUES 
(1, 'Intel'),
(2, 'Amd'),
(3, 'Ati Radeon'),
(4, 'nNvidia'),
(5, 'Motherboards'), 
(6, 'Cpu'), 
(7, 'Harddrive'),  
(8, 'Cases'), 
(9, 'Peripherals'), 
(10, 'Software'), 
(11, 'Computer Systems'), 

 

so say i had "Computer Systems" in right column as a link to that categorie page and when u go to that page if will show a few more from the categories sql say intel and amd.

 

am i going in the right direction with this ?.

Link to comment
https://forums.phpfreaks.com/topic/264200-categories-sql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.