in reply to DBI Error

Do what the error message says. Add
$sth->finish;
before you disconnect.

That error is DBI telling you that you still have an open statement handle when you're disconnecting. It's not a fatal error because DBI can always close them up for you. But an open statement handle at the time of disconnecting could be a sign of problems, and not closing the statement handles could cause you problems. So just call finish on the statement handle.