Skip to content
Permalink
Browse files
Create SQL Query - Sayo
  • Loading branch information
ogundip2 committed Mar 4, 2019
1 parent b2987cf commit 1fa42d3d388ac2f6e7c2ba86a67e9cc70d6cbdbc
Showing 1 changed file with 31 additions and 0 deletions.
@@ -0,0 +1,31 @@
#include <iostream>
#include <string>
using namespace std;

#include "gamedatabase.hpp"


int main()
{
try
{
sqlite::sqlite db( "gamedatabase.sqlite" );

cout << "Retrieve information on ...." << endl;

string userInput;
getline(cin, userInput);

auto cur = db.get_statement();
cur->set_sql("SELECT Age, Ability1, Ability2 FROM player"
"NATURAL JOIN abilities"
"WHERE job = ?;");

cur->prepare();

while (cur->step())
cout << cur->get_int(0) << " " << cur->get_text(1) << endl;
}


}

0 comments on commit 1fa42d3

Please sign in to comment.