Thread DBI::db disconnect invalidates statement handle (10 answers)
Opened by iche at 2012-04-26 16:31

Gast iche
 2012-04-26 17:02
#157869 #157869
Oh, war kein böser Wille :)

Code (perl): (dl )
1
2
3
4
sub mysql_connect {
%attr = ();
my $db = DBI -> connect("DBI:mysql:mysql_compression=1:$databasename:$dbserver:$dbport", "$dbusername", "$dbpassword", \%attr);
return $db;


Code (perl): (dl )
1
2
3
4
sub mysql_disconnect {
if ($dbh) {$dbh -> finish;}
defined $_[0] and ($_[0]->disconnect or die "Keine Verbindung zur MySQL-Datenbank möglich - Grund: $DBI::errstr" and undef $_[0]);
}


Danke!
Last edited: 2012-04-26 17:06:59 +0200 (CEST)

View full thread DBI::db disconnect invalidates statement handle