diff --git a/phosta.pl b/phosta.pl

index 53c4099f5aa8688da8d9b6d13536bf8a896543d9..a64676abfd9588b877bc8ba9b7a214b1f81b0d40 100755

--- a/phosta.pl

+++ b/phosta.pl

@@ -9,6 +9,7 @@ no warnings 'experimental';

use strict;

use feature qw(say);

use POSIX qw(lround);

+use Text::SimpleTable::AutoWidth;

use Scalar::Util qw(looks_like_number);

use Cwd;

use DBI;

@@ -124,15 +125,18 @@ my $total_count = $dbh->selectrow_array("SELECT count(file) from photos");

say "Querying local database with $total_count entries...";

say '';

+ my $tb = Text::SimpleTable::AutoWidth->new();

+

#say get_sql($selected, $grouping);

my $stmt = $dbh->prepare(get_sql($selected, $grouping));

- my @row;

$stmt->execute();

- while (@row = $stmt->fetchrow_array)

+ while (my @row = $stmt->fetchrow_array)

{

- print join(", ", @row), "\n";

+ $tb->row(@row);

}

+ $tb->captions($stmt->{NAME});

+ say $tb->draw;

$dbh->disconnect();

}