I am trying to insert or edit the bit value to "0" or "1", but either returns me a blank.
Could someone tells me how to insert the value in it?
Also, Is that possible to not use bit type but Boolean? I see there's a Boolean type in the list of types
Thanks
Hi, I have uploaded the picture, the cell in the table is blank, but I have tried several times, add, update, all take effect, but cell keeps blank...
Generally speaking, for boolean
or bit
data types, you would use 0
or 1
like so:
UPDATE tbl SET bitCol = 1 WHERE bitCol = 0
See also:
Your issue is in PHPMyAdmin itself. Some versions do not display the value of bit columns, even though you did set it correctly.
If you're using SQL Server, you can set the value of bit fields with 0 and 1
or
'true' and 'false'
(yes, using strings)
...your_bit_field='false'... => equivalent to 0
Source: Stackoverflow.com