Hi,
I receive the following error using $dbh->disconnect:
DBI::db=HASH(0x812938)->disconnect invalidates 1 active statement handle (either
destroy statement handles or call finish on them before disconnecting) at
./pdfshorten.pl line 37.
I do not understand this. It's an extremely simple test script like this. The
relevant part is this:
---
my $dbh = DBI->connect("dbi:mysql:$db:$server", $username, $password, {
RaiseError => 1 });
my $query = "SELECT page_id, content FROM pages WHERE page_id = 1583";
my $sth = $dbh->prepare($query);
$sth->execute();
my ($id, $content) = $sth->fetchrow_array;
# modify $content here
my $query2 = "UPDATE pages SET content = $content WHERE page_id = $id";
my $sth2 = $dbh->prepare($query2);
$sth2->execute();
$dbh->disconnect;
---
In other scripts (used in conjuction with CGI), I never got a warning like this.
Grateful for explanations,
Jan