Use a tinyint field in mysql, (which is what bool gets translated to I think)
and you'll get a number back, 0 = false, 1 = true, and you can:
if ($fieldname) {
do true item;
}
if (!$fieldname) {
do false item;
}
This works for me, I've done before quite a bit in the past.
-Mic
You can cast it to a boolean
(http://phpbuilder.com/manual/en/language.types.type-juggling.php#language.types.typecasting)
if (bool($IsAMember) == true) ...
bastien
From: Larry Bradley <[EMAIL PROTECTED]>
To: [email protected]
Subject: [PHP-DB] Bit(1) datatype from mySQL
Date: Sat, 07 Ja
Warning, this person is acting to own your email account server. He tries to
pretend his from Yahoo!, Hotmail or any email account to see if your account is
active for spam. I got his REAL email address because he messed up an email
and put his real email address. I have confirmed from Hotmai
Greetings:
I'm new to PHP, although I've been a programmer all my life. I had been
doing a bit of web database work with VB Script and ASP and mySQL, and then
decided to try PHP. I've run into a couple of things that bother me.
I have boolean fields (i.e. bit(1)) in the mySQL database. When I