Advertisement
Five_NT

damn

Dec 28th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. QSqlQuery query;
  2.     if(query.exec("SELECT * FROM users WHERE username=\'" + u + "\' and password=\'" + p + "\'")) {
  3.         int count = 0;
  4.         while(query.next()) {
  5.             count++;
  6.         }
  7.         if(count == 1) {
  8.             hide();
  9.             ui2 = new LoggedWindow(this);
  10.             ui2->move(350, 100);
  11.             ui2->show();
  12.         }
  13.         else if(count > 1) {
  14.             ui->lblwrong->setText("Multiple accounts. Contact admins.");
  15.             ui->lblwrong->show();
  16.         }
  17.         else if(count < 1) {
  18.             ui->lblwrong->setText("Incorrect username or password");
  19.             ui->lblwrong->show();
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement