{
query.prepare("INSERT INTO Modules (A,B,C,D) VALUES(:a, :b, :c, d)");
query.bindValue(":a", qry[0]);
query.bindValue(":b", qry[1]);
query.bindValue(":c", qry[2]);
query.bindValue(":d", qry[3]);
if(query.exec())
else
}
void MainWindow::query(QStringList qry)
{
QSqlQuery query;
query.prepare("INSERT INTO Modules (A,B,C,D) VALUES(:a, :b, :c, d)");
query.bindValue(":a", qry[0]);
query.bindValue(":b", qry[1]);
query.bindValue(":c", qry[2]);
query.bindValue(":d", qry[3]);
if(query.exec())
QMessageBox::critical(0, "DB Status","DATABASE UPDATED", QMessageBox::Ok);
else
QMessageBox::critical(0, "DB Status","DATABASE NOT UPDATED", QMessageBox::Ok);
}
To copy to clipboard, switch view to plain text mode
Bookmarks