Is it possible to have a HTML SELECT/OPTION value as NULL using PHP?
All you need is a check on the post side of things.
if(empty($_REQUEST['type_id']) && $_REQUEST['type_id'] != 0)
$_REQUEST['type_id'] = null;
No, POST/GET values are never null
. The best they can be is an empty string, which you can convert to null
/'NULL'
.
if ($_POST['value'] === '') {
$_POST['value'] = null; // or 'NULL' for SQL
}