Having issues with the value being returned from MySQL from an AJAX query that selects a check box. But the only way I can get it to work is to have the value in MySQL as NULL.
But 0 or 1 will return it checked every time. In MySQL I have it set to tinyint(1).
In MySQL boolean is an alias for tinyint(1). I suggest using boolean.
The MySQL writers do things for a reason. I'm sure they have a good reason for choosing tinyint over bit.
You will never get smaller storage requirement than 1 byte.
Make sure you do a check against 1
if $row['bool_field'] == 1 {check that box}
else {uncheck that box}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With