#include #include #include int main() { StderrLog log; Database db("localhost", "root", "", "tutorialdb", &log); Query q(db); q.get_result("select * from playerresource"); while (q.fetch_row()) { db::Playerresource x(&db, &q); db::Player player(db, x.player); db::Resource r(db, x.resource); printf("%s owns %ld piece%s of %s.\n", player.name.c_str(), x.amount, (x.amount == 1) ? "" : "s", r.name.c_str()); } q.free_result(); }