PDOを使用してビット値をPostgreSQL-DBに保存するのに少し問題があります。bit(bool)がfalseの場合は常に、このエラーが発生します
Warning: PDOStatement::execute(): SQLSTATE[22026]: String data, length mismatch: 7
ERROR: bit string length 0 does not match type bit(1) in /var/www/html/application/models/Database.php on line 75
コードの表示は少し複雑ですが、DBクラスに入るのは次のとおりです。
UPDATE users SET name=:name,email=:email,address=:address,zip=:zip,joindate=:joindate,phone=:phone,password=:password,activationcode=:activationcode,birthdate=:birthdate,lastdigits=:lastdigits,driverlicense=:driverlicense,e_presentation=:e_presentation,e_showphone=:e_showphone,e_showaddress=:e_showaddress,e_radius=:e_radius,e_showinsearch=:e_showinsearch,w_presentation=:w_presentation,w_showphone=:w_showphone,w_showaddress=:w_showaddress,w_radius=:w_radius,w_showinsearch=:w_showinsearch WHERE id=:id
そして、パラメータにバインドされているデータ
Array ( [:name] => My Name [:email] => myemail@gmail.com [:address] => My Address [:zip] => 79133 [:joindate] => 2012-09-18 12:39:56.769584 [:phone] => 073 917 13 97 [:password] => c6d18ac44b378ff3cecf09d9ebec31ad301c4394d7e1sdfjksc81cd3fbf47777f8df0ac9f33d14da18d71b76fc9c3e1210cb2efcabf6ed66f779d [:activationcode] => [:birthdate] => 1993-08-05 [:lastdigits] => 5079 [:driverlicense] => 0 [:e_presentation] => Test [:e_showphone] => 1 [:e_showaddress] => 1 [:e_radius] => 10 [:e_showinsearch] => 1 [:w_presentation] => Test [:w_showphone] => 1 [:w_showaddress] => 1 [:w_radius] => 10 [:w_showinsearch] => 1 [:id] => 28 ) 1
簡単なグーグル検索は、他の人が同じ問題を抱えていたが、それに対する解決策がないことを私に示しました。