[PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Donovan Brooke
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

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Daniel Brown
On Tue, Jan 25, 2011 at 17:05, Donovan Brooke li...@euca.us wrote: What is the best PHP practice when using bools with MySQL? Save 1's and 0's instead of true/false? You could either do an INT(1) DEFAULT 0 or an ENUM('Y','N') to make it easier on yourself. -- /Daniel P. Brown Network

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Donovan Brooke
Daniel Brown wrote: On Tue, Jan 25, 2011 at 17:05, Donovan Brookeli...@euca.us wrote: What is the best PHP practice when using bools with MySQL? Save 1's and 0's instead of true/false? You could either do an INT(1) DEFAULT 0 or an ENUM('Y','N') to make it easier on yourself. Thanks

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Daniel Brown
On Tue, Jan 25, 2011 at 17:40, Donovan Brooke li...@euca.us wrote: Thanks Dan, I think the error would still persist using DEFAULT.. because as mentioned, I don't think MySQL likes: UPDATE tablename SET vbool= ..which is not great news for me since I'd like to avoid having to redo all my

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Donovan Brooke
Daniel Brown wrote: On Tue, Jan 25, 2011 at 17:40, Donovan Brookeli...@euca.us wrote: Thanks Dan, I think the error would still persist using DEFAULT.. because as mentioned, I don't think MySQL likes: UPDATE tablename SET vbool= ..which is not great news for me since I'd like to avoid