Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Problem with UPDATE query (QSQLITE)

[Solved] Problem with UPDATE query (QSQLITE)

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 1 Posters 774 Views
  • 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 Offline
    M Offline
    maroko
    wrote on last edited by
    #1

    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
    0
    • M Offline
      M Offline
      maroko
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved