Re: best way to stare true, false
| From: | Andy | Date: | Sun, 11 Aug 2002 15:19:09 +0000 |
| Subject: | Re: best way to stare true, false | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21104@lists.php.net to get a copy of this message | ||
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.globosapiens.net
Global Travellers Network!
"Raquel Rice" <raquel@thericehouse.net> schrieb im Newsbeitrag
news:20020810112746.2b201f0f.raquel@thericehouse.net...
> On Sat, 10 Aug 2002 17:41:56 +0200
> "andy" <news.letters@gmx.de> 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 are false, or true. I think I did read
> > > > something about a way to do this with ENUM, but cant remember
> > > > where and how, all tryes did not succeeed so far.
> > > >
> > > > Thanx for any help on that.
> > > >
> > > > Andy
> > >
> > > How about as a "tinyint" ... 0/1
> > >
> > > --
> > > Raquel
> >
> > hmm.. thats how I am doing it right now. There might be a better
> > way?!
>
> I've never used ENUM, so take what I say with a grain of salt. It
> appears to me that if you use "true" or "false" as your ENUM values,
> those values are stored as strings. In PHP you would then have to
> do string comparisons rather that
> "if ($a) {
> do this;
> }"
>
> Perhaps it depends upon how you use it ... what you do with it?
>
> --
> Raquel
> ============================================================
> The world is not good enough - we must make it better.
> --Alice Walker
>