Answer the question
In order to leave comments, you need to log in
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());
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question