Problem with disconnect

Problem with disconnect

am 29.04.2004 12:19:18 von Jan Eden

Hi,

I receive the following error using $dbh->disconnect:

DBI::db=3DHASH(0x812938)->disconnect invalidates 1 active statement handle =
(either destroy statement handles or call finish on them before disconnecti=
ng) at ./pdfshorten.pl line 37.

I do not understand this. It's an extremely simple test script like this. T=
he relevant part is this:

---
my $dbh =3D DBI->connect("dbi:mysql:$db:$server", $username, $password, { =
RaiseError =3D> 1 });

my $query =3D "SELECT page_id, content FROM pages WHERE page_id =3D 1583";=
=20
my $sth =3D $dbh->prepare($query);
$sth->execute();
my ($id, $content) =3D $sth->fetchrow_array;
# modify $content here
my $query2 =3D "UPDATE pages SET content =3D $content WHERE page_id =3D $id=
";
my $sth2 =3D $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
--=20
There are 10 kinds of people: those who understand binary, and those who d=
on't

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org