Post your sample code, please. But, the basic is:

Qt Code:
  1. int i = 10;
  2. q.prepare(QString::fromUtf8(" SELECT ID_EXAMPLE, FIELD_EXAMPLE FROM TABLE_EXAMPLE WHERE ID_EXAMPLE = ? ");
  3. q.addBindValue(i);
  4. q.exec();
  5. r = q.record();
  6. QString s = q.value(r.indexOf("FIELD_EXAMPLE")).toString();
To copy to clipboard, switch view to plain text mode