Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool DBManager::LoginCheck(const QString &usuario, const QString &senha)
- {
- QSqlQuery query;
- query.prepare("SELECT * FROM usuarios WHERE usuario = :usuario and senha = :senha");
- query.bindValue(":usuario", usuario);
- query.bindValue(":senha", QString(QCryptographicHash::hash((senha.toUtf8()),QCryptographicHash::Md5).toHex()));
- if (query.exec())
- {
- if (query.next())
- {
- // it exists
- qDebug() << "Query existe!";
- return true;
- }
- else {
- qDebug() << "Query não existe!";
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement