Permalink
Cannot retrieve contributors at this time
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?
resittimtable/login and select
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34 lines (26 sloc)
783 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int secondentry(){ /*login your details and check to see if they match the database*/ | |
cout << "Please enter your student details to Login :" <<endl; | |
cout << "Username/Email :"; cin >> log1; | |
cout << "Password Please :" <<endl; cin >> pass1; | |
sqlite3 *db; | |
char *column = 0; | |
int load; | |
string sql; | |
load = sqlite3_open("School.db", &db); | |
if(load){ | |
cout << "DB Error: " << sqlite3_errmsg(db) << endl; | |
sqlite3_close(db); | |
return(1); | |
} | |
sql = "SELECT password FROM STUDENTDETAILS " + username + ";"; | |
load = sqlite3_exec(db, sql.c_str(), callback, 0, &column); | |
if (pass1 == sql){ | |
cout << "Successfull Login" <<endl; | |
Timetablesforstudent(); | |
} | |
else{ | |
cout << "Please try again" <<endl; | |
secondentry(); | |
} | |
return 0; // need to return 0/1 depending on the output | |
} |