X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fccbs_bigscreen.cpp;h=6afc0a082b2ea90b2a8f916af02961a4312be582;hp=02ed0335b93d5510fb62f7037f777decca8da30c;hb=a42992f8c68f7b0b40e43bfe5b3c314796ebbf79;hpb=85b8d8fb245ff3a960d38f92720b1be14edbe52d diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index 02ed033..6afc0a0 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -8,12 +8,12 @@ int main(int argc, char **argv) GLWindow glw("CCBS bigscreen", 800, 600, 32, false, 16, -1); try { pqxx::connection conn("dbname=ccbs host=sql.samfundet.no user=ccbs password=GeT|>>B_"); - pqxx::transaction<> t(conn, "trx"); + pqxx::work t(conn, "trx"); // fetch all songs pqxx::result res( t.exec("SELECT * FROM songs") ); for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) { - std::fprintf(stderr, "%s\n", i[0].as(std::string()).c_str()); + std::fprintf(stderr, "%s\n", i["title"].c_str()); } t.commit(); } catch (const std::exception &e) {