Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boolean Field in mysql db

I want to save my value as a boolean in my mysql database. But somehow Iam not able to save it , mysql automatically saves it of the type tinyInt.Also tell me the default values for boolean. how we pass the values?

like image 292
samir chauhan Avatar asked Jan 21 '11 09:01

samir chauhan


1 Answers

In MySQL BOOLEAN type is a synonym for TINYINT. There is no dedicated BOOLEAN type. The vaules accepeted, are those for TINYINT i.e. 0 for false, 1-255 (preferably 1) for true.

like image 54
Mchl Avatar answered Sep 17 '22 19:09

Mchl