QSqlQuery select老查不出想要的结果
本帖最后由 marsz1990 于 2012-12-27 02:27:48 编辑 如题,我如果用
QSqlQuery query;
query.prepare("delete from users WHERE name = ?");
query.addBindValue(this->userName);
query.exec();
QSqlQuery query;
query.prepare("select ID,name from users where name = ?");
query.addBindValue(this->userName);
query.exec();
QSqlQuery query;
query.exec("select ID,name from users ");
while(query.next()){
qDebug()<<query.value(0).toString());
qDebug()<<query.value(1).toString());
}
QSqlQuery query;
query.prepare("select ID,name from users where name = '?'");
query.addBindValue(this->userName);
query.exec();