I have several fields that may be empty when the form is submitted.
If I fill every field with valid entries, the row is created in the table.
If I leave an optional field empty, the database does not get a new row.
if ($fn && $mi && $ln && $e1 && $e2 && $s1 && $s2 && $c && $z && $fax && $pho && $phh && $phc && $cell && $w1 && $w2 && $st) { // If everything's OK.
echo "<p> $fn $mi $ln $e1 $e2 $s1 $s2 $c $st $z $fax $pho $phh $phc $cell $w1 $w2</p>";
$query = "INSERT INTO ....................";
I am not getting any errors, but the echo of variables before the if statement does display.