I want to insert NULL Value in Database
$managerId = $_POST['managerId'];
if($managerId == 0)
{
$managerId = NULL;
}
else
{
$managerId = 14;
}
$mysql_user_resultset = mysqli_query($con, "INSERT into user (managerId) VALUES ('$managerId')");
I am using like this. Its not working, Value doesn't insert.
How to insert both Null value and some value in Same variable..
Its Because of '$managerId' - single quotation.
How to define for both the types