Important: Please read the Qt Code of Conduct -

[Solved]Can't save to changes to mysql.

  • I can load the table fine. But when I change a value and sort a column or refresh the table the chance is not applied.

    Main (no problems here)
    db = QSqlDatabase::addDatabase("QMYSQL");
    model=new QSqlTableModel(this);

    @void MainWindow::on_Connectsql_button_clicked()
    model->submitAll(); // <- should write model back to database no?

    void MainWindow::loadDB(){
    QString debugg = model->lastError().text();
    qDebug() << debugg;
    qDebug() << QSqlDatabase::drivers();

    for ( int i = 0; i <= 1; i++)
    for ( int i = 3; i <= 25; i++)
    for ( int i = 28; i <= 29; i++)


    Debug output on click button :

    bq. " "
    "Using unsupported buffer type: 380399704 (parameter: 3) QMYSQL3: Unable to bind value"

    The buffer error occurs when i changed a cell and clicked the button.

    Not sure why it shows qmysql3.
    Any guidance in this would be appreciated.

    No clue where the libmysql.dll from 2006 came from. replaced by the one from the mysql lib folder.
    Works now.

Log in to reply