Template
作者:互联网
catalog
promed
数据库插入
query.prepare("INSERT INTO 'userinfo' VALUES (:a1, :a2, :a3, :a4, :a5, :a6, :a7, :a8, :a9, :a10, :a11, :a12, :a13, :a14, :a15); ");
for(int i = 6; i <= 500; ++i){
query.bindValue(":a1", QString::number(i));
query.bindValue(":a2", "姓名");
query.bindValue(":a3", QString::number(i));
query.bindValue(":a4", QString::number(i));
query.bindValue(":a5", QString::number(i));
query.bindValue(":a6", QString::number(i));
query.bindValue(":a7", QString::number(i));
query.bindValue(":a8", QString::number(i));
query.bindValue(":a9", QString::number(i));
query.bindValue(":a10", QString::number(i));
query.bindValue(":a11", QString::number(i));
query.bindValue(":a12", QString::number(i));
query.bindValue(":a13", QString::number(i));
query.bindValue(":a14", QString::number(i));
query.bindValue(":a15", QString::number(i));
if(!query.exec()){ _WC; }
}
标签:a15,a14,number,QString,Template,query,bindValue 来源: https://blog.csdn.net/weixin_42712593/article/details/114396874