Jump to content

MySQL Column Choice


Matias

Recommended Posts

ok lets say there was database that consisted of switchboard values (on or off)

 

column 1 (0 or 1)

column 2 (0 or 1)

column 3 (0 or 1)

column 4 (0 or 1)

column 5 (0 or 1)

column 6 (0 or 1)

 

now all of those are what they are (they define what is activated)

 

anyways right now they have their own correctponding colums, but I want to make them into one line of numbers...

 

so something like this

 

1010110

 

pretty much like chmod only its binary...

 

now which way would be best to do so. Should I make a column that is CHAR(6) or should I make a MEDIUMINT(6) colum.

 

Or if its possible, can a BIT column be made, so its binary

 

 

which way is better

 

Link to comment
Share on other sites

AFAIK, they did add a BIT column type in MySQL 5, so obviously, that would be ideal. In pre-5, I would suspect the INT columns would be better suited, but you can always check the relevant [a href=\"http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html\" target=\"_blank\"]refman page[/a] that discusses column storage requirements.

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.