I am checking to see if a value has been entered in a form and then updating only if a value is entered. The problem is I want 0 to be an option that can be entered and php is treating 0 as if it were the same as NULL which is the default entry in the DB so what I end up with is 0 entered in each column of the DB instead of empty values in some and numerical values in some.
Is there a way to check and see if a number including 0 has been entered and if not to treat the field as NULL?
if ($value != NULL ){
//Update The Standing Order Amount
$insert = "UPDATE custom_items SET AltQuantity='$value' WHERE VisitorID='$_SESSION[VisitorID]' AND ItemID='$item[id]'";
mysqli_query($dbc, $insert);
}
Thanks,
Eric