void addinfo:

n_pushButton_5_clicked()
{
QSqlDatabase db = QSqlDatabase::database("mydb");
QSqlQuery query(db) ;
- - - -- - - -- - - - -- - - - - - -- - -- - - - -- -- - - -- - - - - -- - - - -
for ( int i = 0; i < ui->tableWidget_2->rowCount() - 1; i++ )
{
query.prepare( "REPLASE educationData SET "
"numberOfDiploma = :numberOfDiploma, "
"personalNumber =

ersonalNumber, "
"educationalIsstitution = :educationalIsstitution, "
"typeOfEducation = :typeOfEducation, "
"typeOfTraining = :typeOfTraining, "
"specialty = :specialty, "
"qualification = :qualification ;"
) ;
query.bindValue( ":numberOfDiploma", ui->tableWidget_2->item( i, 0 )->text() ) ;
query.bindValue( "

ersonalNumber", ui->lineEdit->text() ) ;
query.bindValue( ":educationalIsstitution", ui->tableWidget_2->item( i, 1 )->text() ) ;
query.bindValue( ":typeOfEducation", ui->tableWidget_2->item( i, 2 )->text() ) ;
query.bindValue( ":typeOfTraining", ui->tableWidget_2->item( i, 3 )->text() ) ;
query.bindValue( ":specialty", ui->tableWidget_2->item( i, 4 )->text() ) ;
//program crashes somewhere after this point
query.bindValue( ":qualification", ui->tableWidget_2->item( i, 5 )->text() ) ;
//and somewhere before this point
query.exec() ;
qDebug() << "token";
query.clear();
}
Bookmarks