# Check that the things which must have a value have values: if(defined $FORM{Description} and defined $FORM{Title}) { my $sql = "INSERT INTO `mysql_db` (`Title`, `Email`, `City`, `State`, `Country`, `URL`, `Date`, `Description`, `rid`, `dt_create`, `publish` ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; my $sth = $dbh->prepare($sql); $sth->execute($FORM{Title}, $FORM{Email}, $FORM{City}, $FORM{State}, $FORM{Country}, $FORM{URL}, $FORM{Date}, $FORM{Description}, $FORM{rid}, $FORM{dt_create}, $FORM{publish}); $dbh->disconnect; } else { print "You must enter a Description and a Title"; }