Ask for help (maybe) in query.value(0).
-
wrote on 28 Aug 2017, 11:44 last edited by
Here is the code:
QString s = QString("SELECT Numone, Numtwo FROM number");
query.exec(s);
while(query.next()){
QString name1 = query.value(0).toString();
QString name2 = query.value(1).toString(); <--it,'s wrong T^T
qDebug()<<name1; / /Numone
qDebug()<<name2; / /Numtwo
}I want it to output the data of both Numone and Numtwo, however, it just showed me Numone.
How can I get the data of both Numone and Numtwo?
Thanks every viewer. -
wrote on 28 Aug 2017, 12:02 last edited by
Hi,
did u check wat value ur getting from dB, and
is value present in dB for Numtwo?.Thanks,
-
Hi,
did u check wat value ur getting from dB, and
is value present in dB for Numtwo?.Thanks,
wrote on 28 Aug 2017, 12:11 last edited by@Pradeep-Kumar Thanks for your respond!
I have solved it after your suggestion. -
wrote on 29 Aug 2017, 03:54 last edited by
2/4