01/10/2018, 10:54

Login with QT and Mysql

minh đã cố thử đăng nhập với Qt nhưng vẫn bị lỗi , ai biết cách chỉ giúp với ạ
QString username,password;
QSqlQuery query;

if (query.exec("SELECT * FROM login WHERE username='"+username+"'and password='"+password+"'"))
{
    int count=0;
    while(query.next()){
        count++;
    }
   if(count==1)
   {
       qDebug()<<"da ket noi";
   }
   else{
       qDebug()<<"false2";
   }
cnl36 viết 12:55 ngày 01/10/2018

đã giải quyết được .

Bài liên quan
0