photo-stats

statistics processor for the terminal
git clone https://git.clttr.info/photo-stats.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 3552bb1cfe15d8c15fdf720ae03de85345643504
parent f0e39d78d92a5033c651c02ce86863b20b2ce515
Author: René Wagner <rwagner@rw-net.de>
Date:   Fri, 14 Aug 2020 10:56:54 +0200

fix broken sql when omitting time grouping

Diffstat:
Mphosta.pl | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/phosta.pl b/phosta.pl @@ -107,7 +107,7 @@ sub get_sql if ($selected ne '') { $fieldlist = $fieldlist . $selected . ', '; - $grouplist = $grouplist . ','. $selected; + $grouplist = $grouplist . ($grouplist ne '' ? ',' : '') . $selected; } if ( $grouplist ne '' ) { $grouplist = 'GROUP BY '. $grouplist; } @@ -127,7 +127,7 @@ sub query_db my $tb = Text::SimpleTable::AutoWidth->new(); - #say get_sql($selected, $grouping); + say get_sql($selected, $grouping); my $stmt = $dbh->prepare(get_sql($selected, $grouping)); $stmt->execute(); while (my @row = $stmt->fetchrow_array)