Hi my code below checks an email address of stored email address in a mysql database and if it isn't in the db insert it. The problem is it is inserting it but when i view the databse there is just a blank line but yet the row number has gone up.
if( /^From: ([0-9a-zA-Z\.\-\_]{13,})+\@[0-9a-zA-Z\.\-]+$/)
{
if username is 14 or more letters.Insert into database,label subject with spam.
$subject = $_;
#$subject =~ s/Subject: /Subject: !SPAM!/g;
for (my $counter=0;$counter<$#list+1;$counter++)
{
$db = "From: $list[$counter]\n";
if($subject ne $db)
{
my $sql = "INSERT INTO addsubj VALUES ('$subject')";
}
}
$subject =~ s/: /: !SPAM!/g;
print $subject;
}
my $sth = $dbh->prepare($sql) || die "Error preparing: DBI:errstr";
my $result = $sth->execute || die "Error executing: $DBI::errstr";
It must be something with the sql statement but im not to sure.Thanks in advanced cnw40007
if( /^From: ([0-9a-zA-Z\.\-\_]{13,})+\@[0-9a-zA-Z\.\-]+$/)
{
if username is 14 or more letters.Insert into database,label subject with spam.
$subject = $_;
#$subject =~ s/Subject: /Subject: !SPAM!/g;
for (my $counter=0;$counter<$#list+1;$counter++)
{
$db = "From: $list[$counter]\n";
if($subject ne $db)
{
my $sql = "INSERT INTO addsubj VALUES ('$subject')";
}
}
$subject =~ s/: /: !SPAM!/g;
print $subject;
}
my $sth = $dbh->prepare($sql) || die "Error preparing: DBI:errstr";
my $result = $sth->execute || die "Error executing: $DBI::errstr";
It must be something with the sql statement but im not to sure.Thanks in advanced cnw40007