Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    [Solved] Problem with UPDATE query (QSQLITE)

    Installation and Deployment
    1
    2
    648
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      maroko last edited by

      Hi,
      This is my code:
      @
      reference=ui->reference->text();
      pseudo=ui->label_3->text();
      QSqlQuery qry("QSQLITE");
      qry.prepare("UPDATE candidates SET reference= :areference WHERE pseudo= :apseudo;");
      qry.bindValue(":areference",reference);
      qry.bindValue(":apseudo",pseudo);
      if (!qry.exec())
      {
      qDebug() << qry.lastError();
      qDebug()<< qry.executedQuery();
      }
      @

      When running, I get these messages:

      *QSqlError("", "Parameter count mismatch", "")
      "UPDATE candidates SET reference= ? WHERE pseudo= ?;" *

      Can someone help me and thank you.

      1 Reply Last reply Reply Quote 0
      • M
        maroko last edited by

        Sorry but I have changed reference into reference_entreprise and I have forgotten it.That's why it shows me this problem.
        Now the program works correctly.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post