You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
682 B
32 lines
682 B
#include <iostream>
|
|
using namespace std;
|
|
|
|
|
|
#include "../lib/sqlite3.hpp"
|
|
using namespace marcelb::SQlite3;
|
|
|
|
int main() {
|
|
try {
|
|
|
|
SQLite3 mydb("../example/example.db", false);
|
|
|
|
// cout << mydb.ask("Select * from Tab1");
|
|
// cout << mydb.ask("INSERT INTO Tab1 VALUES(3,'Pakora', 'marijanab@bitelex.ml');");
|
|
|
|
auto res = mydb.query("Select * from Tab1 Where id > ?", {"3"});
|
|
// cout << endl << res["NAME"][1];
|
|
|
|
// cout << endl << res["MAIL"][1];
|
|
|
|
for (auto i : res) {
|
|
for (auto j: i.second) {
|
|
cout << i.first << " : " << j << endl;
|
|
}
|
|
}
|
|
|
|
} catch (const string err) {
|
|
cout << err << endl;
|
|
}
|
|
|
|
return 0;
|
|
} |