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
Post a Comment