From: Metabox Date: Sun, 21 Apr 2019 20:38:14 +0000 (+1000) Subject: Cosmetics. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=f6d34c7bb7219a908ed7155eca716c38e71ce34d;p=LifeLog.git Cosmetics. --- diff --git a/htdocs/cgi-bin/search.cgi b/htdocs/cgi-bin/search.cgi index 06cea49..8b38c09 100755 --- a/htdocs/cgi-bin/search.cgi +++ b/htdocs/cgi-bin/search.cgi @@ -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 "

Error->"& $DBI::errstri &"

"; 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 "

Error->"& $DBI::errstri &"

"; my %hshCats; @@ -78,7 +78,7 @@ else{ print $q->end_html; -$dbh->disconnect(); +$db->disconnect(); @@ -86,7 +86,7 @@ sub build{ my $tbl = ''; -$sth = $dbh->prepare( $stm ); +$sth = $db->prepare( $stm ); $rv = $sth->execute() or die or die "

Error->"& $DBI::errstri &"

"; if($rv < 0) { print "

Error->"& $DBI::errstri &"

"; diff --git a/htdocs/cgi-bin/stats.cgi b/htdocs/cgi-bin/stats.cgi index b4aa5d6..6fe67d8 100755 --- a/htdocs/cgi-bin/stats.cgi +++ b/htdocs/cgi-bin/stats.cgi @@ -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 "

Error->". $DBI::errstri ."

"; +my $db = DBI->connect($dsn, $userid, $password, { RaiseError => 1 }) or die "

Error->". $DBI::errstri ."

"; @@ -105,13 +105,13 @@ print '

Server In print '

Processes Info

' . $processes .'
'; 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;
DateTimeLogCategory