Databases :: MySql :: Database design HELP !!! |
|||
| By: Squibi |
Date: 10/03/2003 00:00:00 |
Points: 300 | Status: Answered Quality : Excellent |
|
Hi all, I would like to get help from you experts. I am now designing a database table, I encounter a question. Which is, e.g. They system is going to have many users, each user will have there own choice to choose from various category to make orders online. They use checkbox to select which category they want to see on the web page. If there are only 5 FIXED category, I will be fine, I can just create 5 fields to handle it. But the problem is the category can be create unlimitly by the administrator. So I got stuck here, how should I design it in order to make the best? PLEASE HELP. THANKS IN ADVANCE. |
|||
| By: VGR | Date: 10/03/2003 05:21:00 | Type : Answer |
|
| either build a table summarizing the categories per clients' types (profiles) or per clients' ID, or store a string composed of categories'codes separated by | in the client's record. Display using PHP or javascript so that the number of checkboxes varies with the actual data from the client's record. |
|||
| By: carchitect | Date: 10/03/2003 05:41:00 | Type : Comment |
|
| hi this is ur table structure CREATE TABLE `category` ( `cat_id` tinyint(3) unsigned NOT NULL auto_increment, `category` varchar(25) default NULL, PRIMARY KEY (`cat_id`), UNIQUE KEY `cat_id` (`cat_id`) ) TYPE=MyISAM; create table and add values to it then retrieve from there and create check boxes dynamically.... |
|||
| By: sumotimor | Date: 13/03/2003 19:44:00 | Type : Comment |
|
| Create a category table, place category info in it Create a user table, store user information Each has an auto-increment column that serves as primary key, or use category and user names as primary key. create a link table that stores category and user primary key. This table allows users to have unlimited categories, then just join the three together through the link table to get a list of categories. Let me know if you need more detail. Sumotimor |
|||
| By: Squibi | Date: 13/03/2003 20:02:00 | Type : Comment |
|
| Thanks for the help |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








