I\'m using a bit(1) field to store boolean values and writing into the table using PDO prepared statements.
This is the test table:
CREATE TABLE IF N
you could try this without parameter
if($_POST['bool'] == 1) { $bool = "b'1'"; } else { $bool = "b'0'"; } $statement = $pdo->prepare("INSERT INTO `test` (SomeText,TestBool) VALUES (?,$bool)") ; $statement->execute(array("TEST")) ;
and no security problem