I'd suggest building the query with the checks.
$query = 'INSERT INTO table VALUES (';
$query .= empty($_POST['field1']) ? 'NULL, ' : "'".$_POST['field1']."', ";
$query .= empty($_POST['field2']) ? 'NULL' : "'".$_POST['field2']."'";
$query .= ')';
I don't know how it'll react using double quotes like you are, but using the ANSI standard single quotes, it would literally write the word "NULL" to the field using Wynder's check.