In a mysqli prepared statement, a NULL gets turned into \'\' (in the case of a string) or 0 (in the case of an integer). I would like to store it as a true NULL. Is there a
query("CREATE TABLE test_NULL (id int(11))"); if($query=$mysqli->prepare("insert into test_NULL VALUES(?)")){ $query->bind_param('i',$null); //note that $null is undefined $query->execute(); }else{ echo __LINE__.' '.$mysqli->error; } ?>