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
https://forums.phpfreaks.com/topic/233854-storing-values-in-table/
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

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.