the best approach is to build your sql so that it asks if the post value for that text field has been submitted or not
something like:
$SQL="INSERT INTO `mytable`(`id`,`value1`,`value2`) VALUES (NULL, ";
$SQL .="'".$_POST["alwayspresenttext"]."'";
if (isset($_POST["mytext"])) $SQL .="'".$_POST["mytext"]."'";
else $SQL .= 'NULL';
$SQL.=")";
mysql_query($SQL);
of course that is just an example, you should never enter any unfiltered user data into your tables. so your query should actually look something like so:
function InsertMYStuff($V1,$V2)
{
$SQL="INSERT INTO `mytable` (`id`,`value1`,`value2`) VALUES (NULL,'%s','%s')";
mysql_query(springf($SQL,mysql_real_ecape_string($V1),mysql_real_ecape_string($V2)));
}
if (isset($_POST["myOptionalText"])) InsertMyStuff($_POST["myConstantText"], $_POST["myOptionalText"]);
else InsertMyStuff($_POST["myConstantText"], "NULL");
or something of the sorts