I saw no $dbi->disconnect; statement in your code.  If you do not
disconnect, and the program ends, you will get the above message....

brent



                                                                                       
         
                    "FLAHERTY,                                                         
         
                    JIM-CONT"                 To:     "Beginners (E-mail)" 
<[EMAIL PROTECTED]> 
                    <Jim.Flaherty@cnet        cc:                                      
         
                    .navy.mil>                Subject:     Issuing rollback() for 
database      
                                              handle being DESTROY'd without ex     
plicit      
                    06/11/01 09:00 AM         disconnect().                            
         
                                                                                       
         
                                                                                       
         




Why am I getting this  ??

Issuing rollback() for database handle being DESTROY'd without explicit
disconnect().



the code


#!/usr/bin/perl
####################################
#  Script to maintain  KBHD Stats  #
#   Version  1.0                   #
#   date : 6 Jun 01                #
####################################
# require "subparseform.lib";
# &Parse_Form;
###############################
#  Start Writing the Page     #
###############################
open(LOG,">/var/www/html/kbhd/stats.php");

print LOG "<HTML><HEAD>\n";
print LOG "<Title> Stats for Techs </title>\n";
print LOG "</head>\n";

print LOG "<body bgcolor=\"#C0C0C0\" text=\"FFFF00\">\n";

print LOG "<div align=\"center\">\n";

print LOG "  <h1>Stats Page</h1>\n";
print LOG " </div>\n";
print LOG "<hr align=\"center\" size=\"4\" width=\"80%\">\n";

# <!--  this is the Stats Page , it will have reports total jobs and grades
-->

######################################################
#     get stats
######################################################

use DBI;
my $database = "VHD";
my $data_source = "DBI:mysql:$database";
my $username = "user";
my $password = "password";

$dbh =DBI ->connect($data_source, $username, $password);
my $sth1 = $dbh -> prepare("select count(*)from jobs where status =
'closed'");
$sth1 -> execute or die " unable to execute query ";

my $array_ref = $sth1 -> fetchall_arrayref();
  foreach $row(@$array_ref){

my($closedJ) = @$row;

}


print LOG "<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
print LOG " <font color=\"#800080\"><b>Overall Stats</b></font></p>";
print LOG "<div align=\"center\">\n";
print LOG "  <center>\n";
print LOG "  <table border=\"1\" width=\"80%\">\n";
print LOG "    <tr>\n";

print LOG "<td width=\"38%\" bgcolor=\"#FFFFFF\"><b>";
print LOG "<font color=\"#0000FF\">Number Of&nbsp";

print LOG "Closed Jobs :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
print LOG "</font><font color=\"#000000\">\n";
print LOG "$closedJ </font></b></td>\n";

print LOG "<td width=\"30%\">Total Time</td>\n";
print LOG "<td width=\"34%\">Average time per Call</td>\n";
print LOG "    </tr> \n";
print LOG "</table>\n";

print LOG "<br><hr size=\"4\">\n";
print LOG "<b>Grades for techs </b>\n";

###############################################
#    Query techs names                        #
###############################################
use DBI;
my $database = "VHD";
my $data_source = "DBI:mysql:$database";
my $username = "";
my $password = "";

$dbh =DBI ->connect($data_source, $username, $password);
my $sth1 = $dbh -> prepare("select username from tech1");
$sth1 -> execute or die " unable to execute query ";
my $array_ref = $sth1 -> fetchall_arrayref();
  foreach $row(@$array_ref){

   my($tech) =@$row <mailto:=@$row> ;

  print LOG "<center> $tech </center><br>\n";

print LOG " <table border=\"1\" width=\"40%\" bgcolor=\"#00FF00\">\n";

 print LOG "<TR>\n";

print LOG " <td width=\"57%\"><b>&nbsp;&nbsp; Total Jobs
Completed</b></td>\n";
print LOG " <td width=\"6%\">&nbsp;</td>\n ";
print LOG "<td width=\"37%\">&nbsp;&nbsp; <b><font color=\"#0000FF\">
53</font><

/b></td>\n";
print LOG "    </tr>\n";
print LOG "    <tr> \n";
print LOG "<td width=\"57%\">&nbsp;<b>&nbsp; Total Hours Spent&nbsp;&nbsp;
</b><

/td>\n";
print LOG "<td width=\"6%\">&nbsp;</td>\n";
print LOG "<td width=\"37%\">&nbsp;&nbsp;&nbsp; <font
color=\"#0000FF\"><b>56</b

></font></td>\n";
print LOG "    </tr>\n";
print LOG "    <tr>\n";
print LOG "<td width=\"57%\">&nbsp;</td>\n";
print LOG " <td width=\"6%\">&nbsp;</td>\n";
print LOG "      <td width=\"37%\">&nbsp;</td>\n";
print LOG "    </tr>\n";
print LOG "    <tr>\n";
print LOG "<td width=\"57%\">&nbsp;&nbsp; <font color=\"
#000000\"><b>Average
time to";


print LOG "Complete</b></font> </td>\n";
print LOG "      <td width=\"6%\">&nbsp;</td>\n";
print LOG "<td width=\"37%\">&nbsp;&nbsp;&nbsp; <font
color=\"#0000FF\"><b>67</b

></font></td>\n";
print LOG "    </tr>\n";

print LOG "  </table>\n";

print LOG "<br><br>\n";









}

close(LOG);





Reply via email to