I can't seem to work out how to make an error of my own, output, without the $DBI::errstr being shown.
here is my insert
duplicate entries throw up the $DBD::errstr
my $sth = $connect->prepare ("insert into
main_database.mailing_lists( business_id, email_address, first_name)
values (?, ?, ?)
) or print "This person is already on your mailing list\n";
What have I forgotten.
<pre>DBD::mysql::st execute failed: Duplicate entry 'firstname.lastname@example.org' for key 1 at mailing_list line 665.
oh yeh, if I use insert ignore, the script doesn't error but I don't get the notification that this person is already in the db.