malavika
21st November 2011, 15:04
hey ,
i wish to compare my username and password to my values put in a table say login table.
i'm able to do this validation by using variables within program as follows:
usr="leo";
pass="123";
if(!(ui->lineEdit->text()== usr && ui->lineEdit_2->text() == pass))
{
m.setText(" Username and Password don't match ! ! ! ! Try Again");
m.exec();
}
if(ui->lineEdit->text()== usr && ui->lineEdit_2->text() == pass)
{
hide();
home *homewindow = new home(this);
homewindow->show();
}
this works but i want to compare with values in my database ! please help ! thanks in advance ! ! !
i wish to compare my username and password to my values put in a table say login table.
i'm able to do this validation by using variables within program as follows:
usr="leo";
pass="123";
if(!(ui->lineEdit->text()== usr && ui->lineEdit_2->text() == pass))
{
m.setText(" Username and Password don't match ! ! ! ! Try Again");
m.exec();
}
if(ui->lineEdit->text()== usr && ui->lineEdit_2->text() == pass)
{
hide();
home *homewindow = new home(this);
homewindow->show();
}
this works but i want to compare with values in my database ! please help ! thanks in advance ! ! !