my $q = CGI->new;
-my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1 })
+my $db = DBI->connect($dsn, $userid, $password, { RaiseError => 1 })
or die "<p>Error->"& $DBI::errstri &"</p>";
my $today = DateTime->now;
my $stmtCat = "SELECT * FROM CAT;";
-my $sth = $dbh->prepare( $stmtCat );
+my $sth = $db->prepare( $stmtCat );
my $rv = $sth->execute() or die or die "<p>Error->"& $DBI::errstri &"</p>";
my %hshCats;
print $q->end_html;
-$dbh->disconnect();
+$db->disconnect();
my $tbl = '<table class="tbl">
<tr class="r0"><th>Date</th><th>Time</th><th>Log</th><th>Category</th></tr>';
-$sth = $dbh->prepare( $stm );
+$sth = $db->prepare( $stm );
$rv = $sth->execute() or die or die "<p>Error->"& $DBI::errstri &"</p>";
if($rv < 0) {
print "<p>Error->"& $DBI::errstri &"</p>";
my $database = '../../dbLifeLog/'.$dbname;
my $dsn= "DBI:SQLite:dbname=$database";
-my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1 }) or die "<p>Error->". $DBI::errstri ."</p>";
+my $db = DBI->connect($dsn, $userid, $password, { RaiseError => 1 }) or die "<p>Error->". $DBI::errstri ."</p>";
print '<div style="text-align:left;"><br/><b>Processes Info</b><br/><br/><pre>' . $processes .'</pre></div>';
print $q->end_html;
-$dbh->disconnect();
+$db->disconnect();
exit;
sub selectSQL{
- my $sth = $dbh->prepare( @_ );
+ my $sth = $db->prepare( @_ );
$sth->execute();
my @row = $sth->fetchrow_array();
$sth->finish;