How do I put booleans into a mysql database with prepared statements?

boolean, mysqli, php, prepared-statement

Solution

MySQL doesn't really store booleans anyway, it's a trick.

The actual format is `TINYINT`, which is I guess `integer` for pdo.

You will have to convert true/false to 1/0, with `intval` for example.

Problem

According to the PHP manual, the four variable types for `mysqli->bind_param` are - integer, - double, - string and - blob. What is the best way to insert a boolean?

Original source