Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Login::on_pushButton_clicked(){
- QString user, password;
- user = ui->username->text();
- password = ui->pass->text();
- QSqlQuery qry;
- qry.prepare("SELECT id, name from users WHERE username = :username AND password = :password");
- qry.bindValue(":username", user);
- qry.bindValue(":password", password);{
- int counter = 0;
- while (qry.next()){
- counter++;
- }
- if(counter==1)
- ui -> statuslabel -> setText("Sign in successful");
- if(counter<1)
- ui -> statuslabel -> setText("Sign in unsuccessful");
- }
- }
Add Comment
Please, Sign In to add comment