ConnectDialog::LoginResult ConnectDialog::login()
{
QString stmt
="SELECT [Login](:result, :type, :username, :password);";
q.setForwardOnly(true);
md5=QCryptographicHash::hash(password().toLatin1(),
QCryptographicHash::Md5);
q.prepare(stmt);
q.
bindValue(":result",
QVariant(0), QSql
::InOut);
q.
bindValue(":type",
QVariant(0), QSql
::InOut);
q.bindValue(":username", userName());
q.bindValue(":password", md5);
if(!q.exec())
{
qCritical()<<q.lastError().text();
}
else if(!q.first())
{
qCritical()<<q.lastError().text();
}
qDebug()<<q.record();
ConnectDialog::LoginResult ConnectDialog::login()
{
QSqlQuery q;
QString stmt="SELECT [Login](:result, :type, :username, :password);";
QByteArray md5;
q.setForwardOnly(true);
md5=QCryptographicHash::hash(password().toLatin1(),
QCryptographicHash::Md5);
q.prepare(stmt);
q.bindValue(":result", QVariant(0), QSql::InOut);
q.bindValue(":type", QVariant(0), QSql::InOut);
q.bindValue(":username", userName());
q.bindValue(":password", md5);
if(!q.exec())
{
qCritical()<<q.lastError().text();
}
else if(!q.first())
{
qCritical()<<q.lastError().text();
}
qDebug()<<q.record();
To copy to clipboard, switch view to plain text mode
Bookmarks