if you are storing a bunch of T/F, you can store 8 of them into a single
byte... each bit position will represent one "question"...
you just have to do some BIT manipulation on your end...
andy wrote:
> Hi there,
>
> I am searching for the best way to store true or false inside a MySQL DB.
> W
The smallest amount of database storage is going to be with a TinyInt and if
you set up two constants to represent TRUE and FALSE then all your code will
read correctly and will store correctly. EG:
define("TRUE", 1);
define("FALSE", 0);
now you can use TRUE and FALSE in your program where
Andy,
I do use the "ENUM" technique quite a bit, with good results.
it's even easier if you set the ENUM values to 1 and 0, then when you do a
database query, you don't have to read the string, you can simply check for
it's presence.
Here's a fictitious example:
In user_table, make a field for
oh... no I ment it in a different way..
somehow.. declare 1 enum value and then set it or not. Search for NULL or
not NULL values instead of false /true.
in this direction, but .. hey does nobody do this like that??
Andy
--
http://www.globos
On Sat, 10 Aug 2002 17:41:56 +0200
"andy" <[EMAIL PROTECTED]> wrote:
> > > Hi there,
> > >
> > > I am searching for the best way to store true or false inside
> > > a MySQL DB. With best I mean the most data efficient way and
> > > in the same time the best for fast searching later on the
> > > t
hmm.. thats how I am doing it right now. There might be a better way?!
"Raquel Rice" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Sat, 10 Aug 2002 16:46:54 +0200
> "andy" <[EMAIL PROTECTED]> wrote:
>
> > Hi there,
> >
> > I am searching for the
On Sat, 10 Aug 2002 16:46:54 +0200
"andy" <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I am searching for the best way to store true or false inside a
> MySQL DB. With best I mean the most data efficient way and in the
> same time the best for fast searching later on the table to find
> all which