On 2012-06-08 12:49, Dmitry Korzhevin wrote:

perl check2.pl
DBI::db=HASH(0x1e40ae0)->disconnect invalidates 1 active statement
handle (either destroy statement handles or call finish on them before
disconnecting) at check2.pl line 17.

You didn't fetch all the rows.


#!/usr/bin/perl -l
use strict;
use warnings;

my $dbh = DBI->connect(
    "DBI:mysql:exim_mx1",
    "root", "PASSWORD",
    { PrintError => 0, RaiseError => 1 },
);

my $sth = $dbh->prepare("SELECT * FROM blackuser WHERE id=160");
$sth->execute();

print "rows:", $sth->rows;

undef $sth;  # mimic end-of-scope

$dbh->disconnect;

__END__

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to