Skip to content
Permalink
d053a7859e
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
34 lines (26 sloc) 783 Bytes
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
}