I am trying to insert a FALSE value into the database, with no luck - it inserts an empty row. Column - varchar. If I insert a TRUE value, it inserts 1.
I use mysql, PDO and php.
I also use the DB class, which does nothing more with the query than it prepares and executes it using the prepared PDO instructions.
This query is very simple:
$sql = 'INSERT INTO api_logs_values (value) VALUES (?)';
and then:
$this->_db->query($sql, array(FALSE));
any ideas what is going on?
EDIT:
Added table structure:
api_logs_values | CREATE TABLE `api_logs_values` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `log_id` int(10) unsigned NOT NULL, `name` varchar(255) DEFAULT NULL, `value` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `log_id` (`log_id`,`name`) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8
EDIT2:
I found an error report here https://bugs.php.net/bug.php?id=33876 , but it seems like this is not the right, nice solution for this. Except, possibly, setting the PDO_PARAM_BOOL attribute.
EDIT3:
I found out that the DB class that I use does not bind the parameters separately, but does ($ param) and looks here http://php.net/manual/en/pdostatement.execute.php , it treats all the parameters as PDO: : PARAM_STR, which is incorrect.