Q:

MySQL BIT datatype turns always to 1

I am facing some unexpected behavior with MySQL BIT datatype.  By executing the following PHP code: 
$query="INSERT INTO REQUESTS_OFFERS (PROPOSAL,REQUESTS_REQUESTID,PERIOD)
  VALUES ('".$offer. "','".$requestid. "','".$periodkind."')";     

period column which is of BIT data type is always turning to 1 even if PHP variable $periodkind equals to 0!!   I cannot explain that.  If trying to change manually 1 to 0 inside MySQL there is no problem...
Do you have any idea why that happens? 
Thank you very much

A:

If your column is a BIT datatype, you don't have to wrap your var into " ' " because it will be interpreted as a string and you want a bit. 
Try to remove single quotes and if it doesn't work, try to cast your $periodkind to a bool like this :
(bool)$periodkind

ONLY IF MySQL converts false to 0 and true to 1 in BIT datatype

