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/studentdeatils inserted into database
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
29 lines (24 sloc)
906 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 firstentry(){/*Enter your student details so they are saved in the database*/ | |
cout << "Student ID"; cin >> studentID; | |
cout << "Name :"; cin >> name; | |
cout << "Surname :"; cin >> surname; | |
username = surname + name[0]; | |
cout << "Enter your school email :"; cin >> email; | |
cout << "Password :"; cin >> password; | |
cout << "Enter Password again :"; cin >> retry; | |
if(retry == password){ | |
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 = "INSERT INTO STUDENTDETAILS VALUES(" + studentID + ',' + name + ',' + surname + ',' + username + ',' + email + ',' + password + ");"; | |
load = sqlite3_exec(db, sql.c_str(), callback, 0, &column); | |
sqlite3_close(db); | |
cout << "Succesfully made your student login."<<endl; | |
secondentry(); |