[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Annoying DBD-mySQL error wont go away
I wonder if there's a date issue here. I am getting the same error with
every one of my disconnect methods also!!
Wow!!
I wonder if there are other folk seeing this...
-David
-----Original Message-----
From: Jaime Teng [mailto:jsteng@xxxxxxxxx]
Sent: Monday, November 26, 2001 5:48 PM
To: Perl-Win32-Users@xxxxxxxxxxxxxxxxxxxxxxxx; mysql@xxxxxxxxxxxxxxx
Subject: Annoying DBD-mySQL error wont go away
Hi,
I have been pulling my hair due to this annoying error. x(
****************************************************************************
DBI::db=HASH(0x1d2998c)->disconnect invalidates 1 active statement handle
(either destroy statement handles or call finish on them before
disconnecting)
at C:\WEBSITE\script\default.pl line 721.
****************************************************************************
It is a Perl CGI script and at line 721 is a simple disconnect command:
721 $DBH->disconnect;
722
723 binmode STDOUT;
724 print "Content-type: text/html\cM\cJ";
725 print "Content-length: ",length($HTTP),"\cM\cJ";
726 print "\cM\cJ";
727 print $HTTP;
The error message is straight forward and means that I have an open
mySQL handle that is not closed; example:
$sth=$DBH->prepare("SELECT ......");
$sth->execute;
$DBH->disconnect; <--- should have been a fetch before disconnect.
But I am dead sure I have a result collector:
$sth=$DBH->prepare("SELECT ......");
$sth->execute;
$result = $sth->fetchrow;
I only use three functions: prepare, execute and fetchrow.
For all intents and purposes, I have reviewed the script line per line
and even made sure that each select will give only one result by adding
"LIMIT 1"
$sth=$DBH->prepare("SELECT ...... LIMIT 1");
arrrrrggggggggg!
I am Perl built 626 on win2000. Mysql 3.23.37
I have encountered this kind of errors on Linux+Apache before and I solved
it
via:
$sth=$DBH->prepare("SELECT ......LIMIT 1");
$sth->execute;
while ( $result = $sth->fetchrow ) {1};
It appeared to me that even if only one result is to be expected, mysql
would throw more than one. or is this a problem with DBD-Mysql module?
regards,
Jaime
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@xxxxxxxxxxxxxxxxxxxxxxxx
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <mysql-thread92302@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.