Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   MySQL Datatypes: 2 Bits? (http://www.programmingforums.org/showthread.php?t=10852)

Sane Jul 26th, 2006 10:40 PM

MySQL Datatypes: 2 Bits?
 
Is there any datatype for MySQL that can hold 2 Bits... or as close to three possible values as possible... without going over? I need to be able to hold the values 0/1/2. I'm currently using an int, but since there are 6000 of them, I thought it might help if I used something smaller.

Jimbo Jul 27th, 2006 3:08 AM

From http://dev.mysql.com/doc/refman/5.0/...ric-types.html:
Quote:

As of MySQL 5.0.3, a BIT data type is available for storing bit-field values. (Before 5.0.3, MySQL interprets BIT as TINYINT(1).) In MySQL 5.0.3, BIT is supported only for MyISAM. MySQL 5.0.5 extends BIT support to MEMORY, InnoDB, and BDB
On the storage requirements page though, it says BIT(M) is stored in (M+7)/8 bytes, so it's about the same as a TINYTINT


All times are GMT -5. The time now is 12:49 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC