void dbWindow::add_changes_kraj() {
//we use NULL because this is not php, and it will auto increment on it's own
query.prepare("INSERT INTO :table (id,ime,postna_st) VALUES(NULL,:ime,:postna_st)");
query.bindValue(":table",table_name);
query.bindValue(":ime",edit_ime->text());
query.bindValue(":postna_st",edit_postna_st->text());
query.exec();
//query.exec("insert into kraj values(NULL,'Town','4532')");
emit close();
}
void dbWindow::add_changes_kraj() {
QSqlQuery query;
QString table_name = "kraj";
//we use NULL because this is not php, and it will auto increment on it's own
query.prepare("INSERT INTO :table (id,ime,postna_st) VALUES(NULL,:ime,:postna_st)");
query.bindValue(":table",table_name);
query.bindValue(":ime",edit_ime->text());
query.bindValue(":postna_st",edit_postna_st->text());
query.exec();
//query.exec("insert into kraj values(NULL,'Town','4532')");
emit close();
}
To copy to clipboard, switch view to plain text mode
Bookmarks