c++ - QT5/QSql bindValue query doesn't work -


i have query made qsql

query.prepare("select id,title,content posts order :field :order limit :limit offset :offset"); query.bindvalue(":field",qvariant(field)); query.bindvalue(":order",order); query.bindvalue(":limit",limit); query.bindvalue(":offset",offset); 

i use order value "desc" doesn't work properly. , when

query.prepare("select id,title,content posts order "+field+"  "+order+" limit :limit offset :offset"); query.bindvalue(":limit",limit); query.bindvalue(":offset",offset); 

it works fine , don't know why. values of same type ( qstring , int ). suggestions ?

thanks.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -