]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Sticky row on old data doesn't default to 0, fix.
authorMetabox <redacted>
Tue, 8 Oct 2019 01:34:24 +0000 (12:34 +1100)
committerMetabox <redacted>
Tue, 8 Oct 2019 01:34:24 +0000 (12:34 +1100)
dbLifeLog/main.cnf
htdocs/cgi-bin/main.cgi

index 6a86cb77ed70ccdc3acf37d81274bf81466620e5..364fe0e1f01e4ffeda1d73796a421cbe09c83895 100644 (file)
@@ -77,49 +77,3 @@ UPDATE LOG SET AFLAG=2 WHERE ID_CAT=%EXPENSE_ID%;
 LOG<6>|Run Query ' ver. 1.6
 ALTER TABLE LOG ADD STICKY BOOL DEFAULT 0;
 
-Journo
-
-Rattle out, you out hiding under OZ rock
-minister, shmuck, fly to Canberra
-stush half of air fair fee in ya pocket.
-
-Oh yes, have the right words at the destination.
-Airhostess gives you a blow job, none do masturbation.
-
-bud@
-
-Long Sword Fight
-
-I elbow, hide at back
-my sword, very long.
-
-Test, know the distance
-or poke and thrust 
-as a joke, hit me in the heart?
-
-Whip, you judged
-in 30 seconds of the fight.
-
-bud@
-
-FISH
-
-How you do that,
-have Army, even
-even not allowed?
-
-bud@
-
-
-Emancipator - Natural Cause https://youtu.be/R2h6eQBlUkA
-
-A minster like Peter Dutton
-is not natural selection.
-
-He will go from Australia
-first boat offered to a new shore.
-
-A parasite in politics.
-Cancer to Australian society.
-
-bud@
\ No newline at end of file
index e11942760ce76fa6644b78951cc13f5624f20da0..c3fa05e123b4080e5d5b38c8b10fa42112305aea 100755 (executable)
@@ -175,7 +175,7 @@ print $cgi->start_html(
 my $rv;
 my $st;
 my $stmtCat = "SELECT ID, NAME, DESCRIPTION FROM CAT ORDER BY ID;";
-my $stmt ="SELECT rowid, ID_CAT, DATE, LOG, AMOUNT, AFLAG, RTF, STICKY FROM LOG ORDER BY STICKY DESC, DATE DESC, rowid DESC;";
+my $stmt ="SELECT rowid, ID_CAT, DATE, LOG, AMOUNT, AFLAG, RTF, STICKY FROM LOG WHERE STICKY =1 ORDER BY DATE DESC, rowid DESC;";
 
 $st = $db->prepare($stmtCat);
 $rv = $st->execute() or die "<p>Error->" & $DBI::errstri & "</p>";
@@ -290,7 +290,7 @@ qq(<form id="frm_log" action="remove.cgi" onSubmit="return formDelValidation();"
 ###############
     #
     # Uncomment bellow to see main query statement issued!
-    # print $cgi->pre("### -> ".$stmt);
+     print $cgi->pre("### -> ".$stmt);
     #
     my $tfId      = 0;
     my $id        = 0;
@@ -322,6 +322,20 @@ qq(<form id="frm_log" action="remove.cgi" onSubmit="return formDelValidation();"
     if ( $rv < 0 ) {
         print "<p>Error->" & $DBI::errstri & "</p>";
     }
+
+    &buildLog;
+
+    $stmt ="SELECT rowid, ID_CAT, DATE, LOG, AMOUNT, AFLAG, RTF, STICKY FROM LOG WHERE STICKY != 1 ORDER BY DATE DESC, rowid DESC;";
+    $st = $db->prepare($stmt);
+    $rv = $st->execute() or die or die "<p>Error->" & $DBI::errstri & "</p>";
+    if ( $rv < 0 ) {
+        print "<p>Error->" & $DBI::errstri & "</p>";
+    }
+
+    &buildLog;
+
+sub buildLog {
+
     while ( my @row = $st->fetchrow_array() ) {
 
         $id = $row[0];# rowid
@@ -577,6 +591,7 @@ qq(\n<img src="$lnk" width="$imgw" height="$imgh" class="tag_FRM"/>);
         }
 
     }    #while end
+}#buildLog
 
     if   ( $tfId == 1 ) { $tfId = 0; }
     else                { $tfId = 1; }