I have an integer variable in the php code and when I try insert it into the database, I get 0 instead of null values.
Here is a code snippet
Code: Select all
$sql = 'INSERT INTO '.cms_db_prefix().SOME_TABLE;
$sql .= ' (x, year) VALUES (?,?) ';
$dbresult = & $gCms->db->Execute($sql, array($this->_x, $this->_year));
My first guess was that the corresponding field in SOME_TABLE is not null, but it is nullable.
How can I insert null into an integer column in the table?