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.
In reply to Can not figure out cause of error. by Eagle_f91
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |