Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QSqlQuery qry;
- if(qry.exec("select * from Users where Nick = '"+nick+"' and Password = '"+password+"'" ))
- {
- int count = 0;
- while(qry.next())
- {
- count++;
- }
- if(count == 1)
- {
- if((nick.toStdString()) == "admin")
- {
- MainWindow mainWindow;
- user = &admin;
- mainWindow.show();
- }
- if((nick.toStdString()) == student.nick)
- user = &student;
- if((nick.toStdString()) == professor.nick)
- user = &professor;
- }
- if(count < 1)
- {
- ui->errorLabel->setText("Wrong login or password");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement