I have used the code from one of the post to check for duplicate records based on two fields submission. It does not seem to work. Can someone tell me what am I doing wrong:
LINE: while (<DB> ) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
$line = $_; chomp ($line);
@data = &split_decode($line);
if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";
}
unless ($data[3] eq $in{'Company'}) {
next LINE;
}
if ($data[8] eq $in{'City'}) {
return "This record already exists. If you would a multiple listing of your company or your own personalized page, please contact us.";
}
}
close DB;
Thanks,
Anita
P.S. I have double checked the field numbers and names and they are correct
LINE: while (<DB> ) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
$line = $_; chomp ($line);
@data = &split_decode($line);
if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";
}
unless ($data[3] eq $in{'Company'}) {
next LINE;
}
if ($data[8] eq $in{'City'}) {
return "This record already exists. If you would a multiple listing of your company or your own personalized page, please contact us.";
}
}
close DB;
Thanks,
Anita
P.S. I have double checked the field numbers and names and they are correct