if ($entry_order eq '1') { } { my $insert = "INSERT INTO `mysql_db` (`Title`, `Email`, `City`, `State`, `Country`, `URL`, `Date`, `Description`, `rid`, `dt_create`, `publish`, ) VALUES ("; } #### my $insert; if ($entry_order eq '1') { } $insert = "INSERT INTO `mysql_db` (`Title`, `Email`, `City`, `State`, `Country`, `URL`, `Date`, `Description`, `rid`, `dt_create`, `publish`, ) VALUES ("; #### if ($entry_order eq '0') { $insert .= "\n"; # This will cause an error } } else { $insert .= $_; } } $sth=$dbh->prepare($insert); $sth->execute(); $dbh->disconnect(); #### # Removed code which would cause an error } else { $insert .= $_; } $sth=$dbh->prepare($insert); $sth->execute(); } $dbh->disconnect(); #### if ( $FORM{'Description'} ){ $insert .= "$FORM{'Description'}, '', NOW(), 0) \n\n"; } #### if ( $FORM{'Description'} ){ $insert .= "$FORM{'Description'}, '', NOW(), 0)"; } #### ', '', NOW(), 0); drop table mysql_db; ' #### $insert .= "$FORM{'URL'}"; #### $insert .= $dbh->quote($FORM{'URL'});