Before inserting a new record in the database, how can I check if the same record is present in database table? If present, then it should throw an error message.
My insertion code:
my $sth = $dbh->prepare("INSERT into backlogs (backlogtype, name, startDate, endDate, parent_id) VALUES ('Iteration', '$iter', '" .
$iterations{ $iter }->{start} . " 08:00', '" .
$iterations{ $iter }->{end} . " 18:00', '" .
$project . "');");
$sth->execute() or die $DBI::errstr;
$sth->finish();