daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Nov 6th, 2018 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top