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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.