View Full Version : mysql problem - changes bool to tinyint
after i selcted bool in Data Type, and try to save it, it automatically changes it to tinyint, and then if i try to change it back to bool, and save it, it reports error. what's up with it? how can it select bool?
sWo0p
08-23-2005, 07:07 PM
well i can tell you im in a simular possition.. :D DB does'nt take a date and is strugeling with prijcing.. (99,99.00) but i'll get it..
what do you wanne add in bool row??? (and i just took a peek in my phpmyadmin.. but WTF is bool) ?
bool means boolean (true or false). i want to have true or false conditions in bool row. :)
have you tried running a query instead of just using the create a table thing?
nope let me try that, thanks :)
ok, i just found out about this from another forum.
in mySQL, there really is no boolean field type. BIT, BOOL and BOOLEAN are simply synonyms for TINYINT(1). A value of zero is considered false. Non-zero values are considered true.
i was still writing the sql query. great (sarcastically)
never knew that. then again never used the bool thing. i just use text or int :P
couldn't you do something like:
$row['boolField'] = $row['boolField'] ? true : false;
so that it converts the 1/0 to true/false.
hope this helps :thumb:
Ilija Studen
08-24-2005, 08:48 AM
Or:
$row['boolField'] = (boolean) $row['boolField'];
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.