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
https://forums.phpfreaks.com/topic/3097-mysql-column-choice/
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
https://forums.phpfreaks.com/topic/3097-mysql-column-choice/#findComment-10403
Share on other sites

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.