Guest User

Untitled

a guest
Nov 6th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. void Login::on_pushButton_clicked(){
  2. QString user, password;
  3. user = ui->username->text();
  4. password = ui->pass->text();
  5.  
  6. QSqlQuery qry;
  7. qry.prepare("SELECT id, name from users WHERE username = :username AND password = :password");
  8. qry.bindValue(":username", user);
  9. qry.bindValue(":password", password);{
  10. int counter = 0;
  11. while (qry.next()){
  12. counter++;
  13. }
  14. if(counter==1)
  15. ui -> statuslabel -> setText("Sign in successful");
  16. if(counter<1)
  17. ui -> statuslabel -> setText("Sign in unsuccessful");
  18. }
  19. }
Add Comment
Please, Sign In to add comment