Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QSqlQuery query;
- if(query.exec("SELECT * FROM users WHERE username=\'" + u + "\' and password=\'" + p + "\'")) {
- int count = 0;
- while(query.next()) {
- count++;
- }
- if(count == 1) {
- hide();
- ui2 = new LoggedWindow(this);
- ui2->move(350, 100);
- ui2->show();
- }
- else if(count > 1) {
- ui->lblwrong->setText("Multiple accounts. Contact admins.");
- ui->lblwrong->show();
- }
- else if(count < 1) {
- ui->lblwrong->setText("Incorrect username or password");
- ui->lblwrong->show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement