QT5/QSql bindValue query doesn't work <p>I have a query made with QSql </p> <pre><code>query.prepare("SELECT id,title,content FROM posts ORDER BY :field :order LIMIT :limit OFFSET :offset"); query.bindValue(":field",QVariant(field)); query.bindValue(":order",order); query.bindValue(":limit",limit); query.bindValue(":offset",offset); </code></pre> <p>I use order value as "DESC" but it doesn't work properly. But , when I do </p> <pre><code>query.prepare("SELECT id,title,content FROM posts ORDER BY "+field+" "+order+" LIMIT :limit OFFSET :offset"); query.bindValue(":limit",limit); query.bindValue(":offset",offset); </code></pre> <p>it works fine and I don't know why. The values are of the same type ( QString and int ). Any suggestions ? </p> <p>Thanks.</p>