Jump to content

Storing values in table


liamloveslearning

Recommended Posts

Hi all,

 

I need to create a table which holds a list of values, for EG

 

1        PHP

2        MySQL

3        HTML

4        JS

 

The reason im doing this is so when a user visits X page on my site, they are presented with a list of possible options which they can tick, for instance if you were asked what languages your fluent with you would tick HTML and JS (or w/e applies to you)

 

What would be the best way of constructing the table?

 

Thanks

Link to comment
Share on other sites

create a table with what ever other field you wana use to identify the user  and a fielf for each langrage ex:

 

CREATE TABLE IF NOT EXISTS `roster_talenttree_data` (

  `id` int(11) NOT NULL default '0',

  `js` tinyint(2) NOT NULL default '0',

  `html` tinyint(2) NOT NULL default '0',

  `php` tinyint(2) NOT NULL default '0',

  `js` tinyint(2) NOT NULL default '0',

  PRIMARY KEY  (`id`)

) ;

 

then use 1 for yes o is default so its no .. id can be user is or change it to varchar and be user name

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.