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 <stdlib.h>
//#include <fstream>
//#include <winsqlite/winsqlite3.h>
using namespace std;
string inputText;
// function inputLogin gets the
// input of the user
string inputLogin(string inputText)
{
string input;
cout << "Enter your " + inputText + ": " << endl;
cin >> input;
return input;
}
// function login uses the inputLogin function and
// uses it to get the username and password input
// for each user and also checks if the users exist
// in the database
string login()
{
string username = "username";
string usernameInput = inputLogin(username);
//sqlite3* db;
//sqlite3_open("Timetablex.db", &db);
//auto checkingUsername = db("SELECT * FROM Account WHERE (AccountName = " + usernameInput + ";");
//if (checkingUsername = NULL)
//{
// cout << "This username doesn't exist. Try a different username.";
// return "Restart the program";
//}
//else
//{
string password = "password";
string passwordInput = inputLogin(password);
/* auto checkingPassword = db("SELECT * FROM Account WHERE (password = " + passwordInput + ";");
sqlite3_close();
if (checkingPassword = NULL)
{
cout << "This password doesn't exist. Try a different password.";
return "Restart the program";
}
else
{*/
system("CLS");
return usernameInput;
// }
//}
};