I'm just trying to set some value = "0", but it's automatically convert into NULL.
$result_checkups = mysql_query("INSERT INTO TABLE1 (COL1, COL2) VALUES (".(!empty($COL1) ? "'$COL1'" : "NULL").", ".(!empty($COL2) ? "'$COL2'" : "NULL").") or die(mysql_error());
It's my code - it look so strange, becouse I need to set NULL, when someone trying to set empty string ("").
But now, when COL2="0"
, then it's NULL
behind MySQL (to clear, when COL2="1"
, it's "1" behind MySQL).
Where is problem?
MySQL table:
CREATE TABLE `TABLE1` (
`COL1` TIMESTAMP NULL DEFAULT NOW(),
`COL2` TINYINT(1) NULL);