Skip to content
Permalink
a7528af2b7
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
44 lines (32 sloc) 1008 Bytes
#include <iostream>
#include <array>
#include <string>
#include "libsqlite.hpp"
using namespace std;
int showLecturers(){
sqlite::sqlite db("4007database.db");
auto cur = db.get_statement();
cur->set_sql("SELECT * FROM LecturerTable;");
cur->prepare();
while( cur->step()){
cout <<" "<< cur->get_int(0) << " " << cur->get_text(1) <<endl;
}
}
int showStudents(){
sqlite::sqlite db("4007database.db");
auto cur = db get_statement();
cur->set_sql( "SELECT * FROM StudentTable" );
cur->prepare();
while( cur->step()){
cout <<" "<< cur->get_int(0) << " " << cur->get_text(1) << " " << cur->get_int(2)<<endl;
}
}
int showModules(){
sqlite::sqlite db("4007database.db");
auto cur = db.get_statement();
cur->set_sql( "SELECT * FROM ModuleTable" );
cur->prepare();
while( cur->step()){
cout <<" "<< cur->get_int(0) << " " << cur->get_text(1) <<endl;
}
}