SHARE
TWEET

Untitled

a guest Jul 31st, 2019 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool DBManager::LoginCheck(const QString &usuario, const QString &senha)
  2. {
  3.     QSqlQuery query;
  4.     query.prepare("SELECT * FROM usuarios WHERE usuario = :usuario and senha = :senha");
  5.     query.bindValue(":usuario", usuario);
  6.     query.bindValue(":senha", QString(QCryptographicHash::hash((senha.toUtf8()),QCryptographicHash::Md5).toHex()));
  7.  
  8.     if (query.exec())
  9.     {
  10.        if (query.next())
  11.        {
  12.           // it exists
  13.           qDebug() << "Query existe!";
  14.           return true;
  15.        }
  16.        else {
  17.             qDebug() << "Query não existe!";
  18.             return  false;
  19.        }
  20.     }
  21. }
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