t* my version of playonbsd.com data URI git clone git://git.codevoid.de/playonbsd-sdk.git DIR Log DIR Files DIR Refs DIR README --- DIR commit 58a23140ef8801ee93933802af7312c9d106d416 DIR parent 84424a4d0971bf785c6b1a20d1c04162bae8787f URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de> Date: Mon, 11 May 2020 12:47:10 +0200 retab Diffstat: M lib/PlayOnBSD.pm | 37 +++++++++++-------------------- 1 file changed, 13 insertions(+), 24 deletions(-) --- DIR diff --git a/lib/PlayOnBSD.pm b/lib/PlayOnBSD.pm t@@ -35,29 +35,18 @@ sub init_db { get '/' => sub { my $db = connect_db(); -# SELECT -# trackid, -# tracks.name AS track, -# albums.title AS album, -# artists.name AS artist -# FROM -# tracks -# INNER JOIN albums ON albums.albumid = tracks.albumid -# INNER JOIN artists ON artists.artistid = albums.artistid; - - my $sql = 'SELECT - game.id AS GameID, - game.name AS GameName, - game.imgsrc AS ImgSrc, - engine.name AS EngineName, - engine.name AS EngineID, - storelist.id AS StoreID, - game.comment AS GameComment, - game.createdat AS GameCreatedAt, - game.changedat AS GameChangedAt - FROM - game + game.id AS GameID, + game.name AS GameName, + game.imgsrc AS ImgSrc, + engine.name AS EngineName, + engine.name AS EngineID, + storelist.id AS StoreID, + game.comment AS GameComment, + game.createdat AS GameCreatedAt, + game.changedat AS GameChangedAt + FROM + game INNER JOIN engine ON engine.id = game.engine_id ORDER BY game.id DESC'; t@@ -68,9 +57,9 @@ get '/' => sub { $sth->execute or die $sth->errstr; - my $res = $sth->fetchall_hashref('game_id'); + my $res = $sth->fetchall_hashref('game_id'); - print Dumper($res); + print Dumper($res); template 'index.tt', { games => $res