Try moving your $dbh->disconnect call after it prints out the fetchrow_array() 

 my ($t_user,$t_password,$t_prefs) = $sql_check->fetchrow_array();
     if($debug_state) {
     print "S: $t_user,$t_password,$t_prefs\n";
    }
$dbh->disconnect();

If your using an older version of DBI, like 1.13 or .14 you may need to call the
finish() after you execute() your statement handle.

sql,database,mysql

On Wed, 27 Feb 2002 11:07:51 -0500, "Shon Stephens"
<[EMAIL PROTECTED]>   wrote:

>>i am trying to write a program in perl and am getting a mysql error from my
>>module. here is the error:
>>
>>DBI::db=HASH(0x294738)->disconnect invalidates 1 active statement handle
>>(either destroy statement handles or call finish on them before
>>disconnecting) at ./pop.pl line 124, <GEN1> line 2."
>>
>>i think a finish statement is what i need, but i don't know how to exec it
>>properly. here is the code loop that generates this message
>>
>>       my $sql_check = $dbh->prepare("select user,password,prefs from users
>>where username='$LNAME'");
>>        # I dont like the below die statement, it should exit gracefully.
>>        $sql_check->execute or die "Can't connect to users table :
>>$dbh-errstr";
>>        my ($t_user,$t_password,$t_prefs) = $sql_check->fetchrow_array();
>>        $dbh->disconnect;
>>        if($debug_state) {
>>                print "S: $t_user,$t_password,$t_prefs\n";
>>        }

Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225)686-2002
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to