Eagle_f91 has asked for the wisdom of the Perl Monks concerning the following question:
The error I get is:#!/user/bin/perl -w ###################################################################### +######### # Copyright (c) 2005 Matt Verstraete - All Rights Reserved. + # # Modification, distribution, selling of this script is prohibited. + # # Use of this script anywhere but crystalreverie.com is prohibited. + # ###################################################################### +######### use strict; use CGI q~:standard~; use DBI; my ($dbh, $sth, @resultholder, $uid, $password, $character); $uid = param('uid'); $password = param('password'); print "Content-type: text/html\n\n"; print q~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Modify Your Character's Information</title> <meta name="publisher" content="Matt Verstraete" /> <meta name="copyright" content="2005 Matthew Verstraete" /> <meta http-equiv="Expires" content="-1" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1 +" /> <style type="text/css"><!-- body {background-color: #cccccc; color: #009900} .center {text-align: center} --></style> </head> <body>~; $dbh = DBI -> connect ('dbi:ODBC:read', 'uid', 'pass') or die "Could n +ot open database: $DBI::errstr; stopped"; $sth = $dbh -> prepare (qq~select character_name, uid from characters +where character_name = 'Sirmatt'~) or die "Could not prepare statemen +t: $DBI::errstr; stopped"; $sth -> execute() or die "Could not execute SQL statment: $DBI::errstr +; stopped"; @resultholder = $sth -> fetchrow_array; $dbh -> disconnect(); print qq~\n</body> </html>~;
Line 34 is the dbh -> prepare code. I have about 5 other scripts running fine and all the code related to the DB is copyed from one of the working ones with NO modification. So my question is, Why does this code work perficly fine in the other scripts but in this extreamly simple script does it fail?DBI::db=HASH(0x18a0ea0)->disconnect invalidates 1 active statement han +dle (eithe r destroy statement handles or call finish on them before disconnectin +g) at D:\crystalreverie.com\www\members\modify.pl line 34.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can not figure out cause of error.
by jZed (Prior) on Aug 13, 2005 at 02:47 UTC | |
|
Re: Can not figure out cause of error.
by pg (Canon) on Aug 13, 2005 at 03:28 UTC | |
by Anonymous Monk on Aug 13, 2005 at 11:33 UTC | |
by jZed (Prior) on Aug 13, 2005 at 18:23 UTC | |
by Eagle_f91 (Acolyte) on Aug 13, 2005 at 20:02 UTC | |
by jZed (Prior) on Aug 13, 2005 at 20:16 UTC | |
| |
by Eagle_f91 (Acolyte) on Aug 13, 2005 at 11:41 UTC |