Shon 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(); # Here insert: $sql_check->finish(); > $dbh->disconnect; > if($debug_state) { > print "S: $t_user,$t_password,$t_prefs\n"; > } According to the DBI documentation, the finish statement is only needed if there are more rows available to fetch. Are you sure that your query can only return 1 row?
Regards, Paul Paul B. van den Berg email: [EMAIL PROTECTED] Department of Social Pharmacy and Pharmacoepidemiology University Centre for Pharmacy tel:31-50-3633331 fax:31-50-3632772 Ant. Deusinglaan 1 9713 AV Groningen Netherlands --------------------------------------------------------------------- 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