QT 数据库
代码:
/* query1.exec("select * from music where myself='abcdef' ");
while (query1.next()) {
t = query1.value(1).toString();
qDebug() << t;
}
query1.exec("select * from music where myself='aaccdd' ");
while (query1.next()) {
t2= query1.value(1).toString();
qDebug() << t2;
}
query1.exec("select *from music where myself='eacdf' ");
while(query1.next()){
t3=query2.value(1).toString();
qDebug()<<t3;
}*/
问题:
我需要把主键(myself)是上面‘ ’里面的内容提取出来然后分别赋值给 t, t2, t3。用我上面的方法只可以得到t,其他两个得不到,不知道为什么??