daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool database::setUsernameAndPassword(QString username, QString password) {
  2.     QSqlQuery query;
  3.  
  4.     QString command = "INSERT INTO users (username, password) VALUES ('%1', '%2');";
  5.     command = command.arg(username)
  6.                      .arg(password);
  7.  
  8.     qDebug() << "command : " << command;
  9.  
  10.     if(!query.exec(command) || username == "" || password == "") {
  11.         qWarning() << "ERROR SET USERNAME: " << query.lastError().text();
  12.         return false;
  13.     }
  14.     return true;
  15. }
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