@shakedko
IF AN EXPERT SAYS IT CAN'T BE DONE GET ANOTHER EXPERT.
- DAVID BEN-GURION

PHP: Insertpdate MySQL BIT(1) field

Today I`v noticed to interested things:ย 

  1. A nice sentence or a motto that I really liked:ย 

    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)

  2. Didn't find any straight answer on Google for my question: "How to insert\update a bit field with PHP?":ย 

So with MySQL you would use:

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

And with PHP you would use boolean type:ย 

<?php
//$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'

Hope I helped, Shak.