From: Metabox Date: Tue, 8 Oct 2019 01:34:24 +0000 (+1100) Subject: Sticky row on old data doesn't default to 0, fix. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=24656d9b86f1a3710091839175efcb943cc9bb25;p=LifeLog.git Sticky row on old data doesn't default to 0, fix. --- diff --git a/dbLifeLog/main.cnf b/dbLifeLog/main.cnf index 6a86cb7..364fe0e 100644 --- a/dbLifeLog/main.cnf +++ b/dbLifeLog/main.cnf @@ -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 diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index e119427..c3fa05e 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -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 "

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

"; @@ -290,7 +290,7 @@ qq(
pre("### -> ".$stmt); + print $cgi->pre("### -> ".$stmt); # my $tfId = 0; my $id = 0; @@ -322,6 +322,20 @@ qq(Error->" & $DBI::errstri & "

"; } + + &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 "

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

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

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

"; + } + + &buildLog; + +sub buildLog { + while ( my @row = $st->fetchrow_array() ) { $id = $row[0];# rowid @@ -577,6 +591,7 @@ qq(\n); } } #while end +}#buildLog if ( $tfId == 1 ) { $tfId = 0; } else { $tfId = 1; }