Programming Forums
User Name Password Register

RSS Feed

Thread Tools Display Modes
Old Jul 26th, 2006, 10:40 PM   #1
Programming Guru
Sane's Avatar
Join Date: Apr 2005
Location: Google / Kitchener
Posts: 4,154
Rep Power: 18 Sane has a spectacular aura aboutSane has a spectacular aura about
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old Jul 27th, 2006, 3:08 AM   #2
Battle Programmer
Jimbo's Avatar
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 887
Rep Power: 12 Jimbo is on a distinguished road
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
Jimbo is offline   Reply With Quote


« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial - Using MySQL in C# Darkhack C# 14 Dec 28th, 2008 7:04 PM
MySQL with python? snipertomcat Python 2 Apr 13th, 2006 2:34 AM
Simple Perl / MySQL Problem.. pls help! domquemo Perl 0 Jan 11th, 2006 5:08 AM
Php, Mysql, Perl scorpiosage Other Web Development Languages 0 Jul 3rd, 2005 10:47 PM
Problem Inserting Values into mySQL from PHP stakeknife PHP 1 Mar 23rd, 2005 9:45 AM

DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:46 AM.

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