P
P
prosto_anton2014-08-06 17:19:10
Qt
prosto_anton, 2014-08-06 17:19:10

Why is the UPDATE query (QT SQLITE) not running?

I work with sqlite from qt. Requests for adding and selecting work fine, they do not work for updating and deleting, or rather, the exec () function returns true, but I do not observe the result of the request in the database.

QString query = "UPDATE `mic` SET name='?', micType='?', accuracy='?', "
                        "perform='?', power='?', price='?', bodyType='?', ifType='?', "
                        "outType='?', bit='?', vendor='?', integType='?', fD='?', "
                        "channelCount='?', modul='?', cascadeCount='?', "
                        "quantizerLevel='?', filter='?', year='?', about='?' "
                        "WHERE id='?'";
// код
this->query.prepare(query);
// код
this->query.addBindValue(item->text());

Perhaps the problem is in the quotes surrounding the parameters ('?'), but without them " Parameter count mismatch". In an append request, the situation is reversed.
Advise something, otherwise the skis do not go. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2014-12-23
@IGHOR

Quotes are not needed "perform='?'"
Should be "perform=?" (because addBindValue will add one more quotes for the texts, and they are not needed).
Count the number of characters? and query.addBindValue

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question