PHP: Insert or update MySQL BIT(1) field

How to insert or update a MySQL bit field with PHP

When you do a search, and it comes back with no results, it’s a sign that you need to write something. (Gordon P. Hemsley)

I couldn't find an answer on Google regarding my question: "How to insert\update a bit(1) field with PHP?".With MySQL one would use:

INSERT INTO t SET b = b'1'; // Or b'0'

While with PHP one would use boolean type:

//$db instanceof ActiveRecord, that's only for the following example
//you can use other ways to insert\update your MySQL DB.
$db->insert(array('b'=>true,'c'=>false)); //true = b'1' , false = b'0'
$db->update(array('b'=>true,'c'=>false)); //true = b'1' , false = b'0'

I hope it helps,