bool type (between MySQL and PHP)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I'm having some issues with bool's relating to MySQL.

I am using:

$tvar = true;
$tvar = false;

in PHP, but only the TRUE value gets
accepted by the MySQL insert or update's.

It appears MySQL sees the TRUE value as 1..
because that is what shows up.. and that MySQL
throws an error when false because the query:

UPDATE tablename SET vbool=$tbool

parses to:

UPDATE tablename SET vbool=

which throws a syntax error.

What is the best PHP practice when using bools with
MySQL? Save 1's and 0's instead of true/false?

TIA!,
Donovan



--
D Brooke

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux