Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <iostream>
#include "libsqlite.hpp" // sqlite library
#include <sstream>
#include <string>
#include <vector>
using namespace std;
void deck_2()
{
sqlite::sqlite db( "table_3.sqlite" ); // open database
auto cur = db.get_statement(); // create query
cur->set_sql( "SELECT * FROM table_3 ORDER BY random() LIMIT 4 ;");
cur->prepare(); // run query
cur->step();
string attack_1, attack_2;
attack_1 = cur->get_text(0);
attack_2 = cur->get_text(1);
while( cur->step() ) // loop over results
cout << cur->get_text(0) << "\nAttack 1: " << cur->get_text(1) << "\nAttack 2: " << cur->get_text(2) << "\nAttack 3: " << cur->get_text(3) <<"\n "<< endl;
}
int main()
{
deck_2();
}