]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Cosmetics.
authorMetabox <redacted>
Sun, 21 Apr 2019 20:38:14 +0000 (06:38 +1000)
committerMetabox <redacted>
Sun, 21 Apr 2019 20:38:14 +0000 (06:38 +1000)
htdocs/cgi-bin/search.cgi
htdocs/cgi-bin/stats.cgi

index 06cea4947997db5396333fbf8d6a279a31b1a0f0..8b38c095a16294aa039fd16b06fba4c2d05163b8 100755 (executable)
@@ -21,7 +21,7 @@ my $password = $ENV{'DB_PASS'};
 
 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;
@@ -30,7 +30,7 @@ $today->set_time_zone( 'Australia/Sydney' );
 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;
@@ -78,7 +78,7 @@ else{
 
 print $q->end_html;
 
-$dbh->disconnect();
+$db->disconnect();
 
 
 
@@ -86,7 +86,7 @@ sub build{
 
 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>";
index b4aa5d656279b983675ba43bfc203d42da7f5416..6fe67d81434dda77193d18260904e60c3056a000 100755 (executable)
@@ -29,7 +29,7 @@ if(!$userid||!$dbname){
 
 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>";
 
 
 
@@ -105,13 +105,13 @@ print '<div style="text-align:left;  border: 1px solid black;"><br/><b>Server In
 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;