colt
(Linija)
March 29, 2010, 6:50pm
1
Hi friends,
I believe a lot of webdev’s have faced this type of problem:
Running Dev WebServer on Win+XAMPP(same with WAMP)
Yii 1.1.1(believe this is not mainly Yii bug)
When fetching boolean attributes from DB instead of 1/0 it shows:
Thanks
CoLT
colt
(Linija)
April 24, 2010, 11:18am
2
If any one has the same problem:
Solved by changing table attribute type from BIT (boolean) to INT.
mikl
(Mike)
April 25, 2010, 8:32am
3
Did you try TINYINT(1)? INT would be a huge waste of resources
colt
(Linija)
April 25, 2010, 12:24pm
4
Yeah, this is true. I’ll try it too
Its strange why BIT in one Server is 0/1 and in other like Japanese symbols(posted above)
mikl
(Mike)
April 25, 2010, 1:02pm
5
Where exactly do you see these symbols? Usually it means somethin is interpreted as a character code (a.k.a. string) where it shouldn’t.
colt
(Linija)
April 25, 2010, 8:42pm
6
These are appearing in the default Yii Crud list/manage etc. (BIT’s were gathered from DB)
Also strange thing - some servers were showing 1/0 properly.
lgoss007
(Lgoss007)
April 26, 2010, 6:45pm
7
Since you’re using XAMPP, this may be a MySQL thing. MySQL handles bits a little weird (have to use b or 0b), I think it’s better using TinyInt. MySQL Bits
colt
(Linija)
April 26, 2010, 10:57pm
8
Thanks for sharing your opinions!
I’ll stick with TinyInt